jquery - Sticky header with transition animation -


$(function () {     $('#nav').data('size', 'big'); });  $(window).scroll(function () {     if ($(document).scrolltop() > 0) {         if ($('#nav').data('size') == 'big') {             $('#nav').data('size', 'small');             $('#nav').stop().addclass('nav-min');         }     } else {         if ($('#nav').data('size') == 'small') {             $('#nav').data('size', 'big');             $('#nav').stop().removeclass('nav-min');         }     } }); 

.. works perfectly, menu jumps normal min, possible somehow animate transition looks smooth?

thanks

to animate and change classes...

$('#nav').stop().animate({...}, 999, function() {     $('#nav').addclass('nav-min'); }): 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -