The following picks up the scrollTop value and adjusts css as expected:
$(window).scroll(function() {
if($window.scrollTop()>918){
$menu.css({top:'0px'});
}
else{
$menu.css({top:'80px'});
}
}
but the following (much nicer effect) doesnt. It fires seemingly intermittently when scroll event has finished
$(window).scroll(function() {
if($window.scrollTop()>918){
$menu.animate({top:'0px'},100);
}
else{
$menu.animate({top:'80px'},100);
}
}
Anyone any ideas why? so simple but driving me mental. Sure I am missing something, any help greatly appreciated