Double menu with jQuery

Asked

Viewed 52 times

1

I would like to know how I make a menu like this site => http://ghfly.com/, preferably using only jQuery and VLWS css!

  • Please give more details about what you want to do, depending on, I have some functional examples that I did on some sites, or even could dig a little deeper, so you could develop something even better than you plan :D

  • If possible also, make available what you have managed to accomplish so far

1 answer

1

To make this "second menu" effect, you can change the CSS when the page position is greater than x.

With that jQuery:

$(window).scroll(function(){
    x = 100;

    if ($(this).scrollTop() > x){

        // Aparece com efeito de meio segundo e fixa no topo da pagina
        $('#cabecalho').slideDown(500).css({'position':'fixed'});
    } 
});
  • complicated dms one thing that is easy to do :/ but the effect of slide down is really accurate :)

  • Why do you say that? It’s only 5 lines... The rest is not necessary?

  • variable declaration x = 100 unnecessary, this is already, even if insignificant an unnecessary thing, imagine if you make a big code and fill with unnecessary statements, it already gives an extra weight, all right, just one line, but it is good to avoid always :)

  • 1

    It was just to demonstrate that there may be any value, but thanks for the comment :)

  • I understand :D so it was a good demonstration

Browser other questions tagged

You are not signed in. Login or sign up in order to post.