Vote count:
0
So I have this code that makes a div box shorter or longer, depending on the scroll position. The thing is, if the user scrolls down then scrolls up really quickly, it makes it shorter, then hangs for about a second before it makes the div longer again. Why is this?
$(window).bind('scroll', function() {
if ($(window).scrollTop() > 60) {
$("ul.undermenu").animate({width:'100px'}, 500);;
}
else {
$("ul.undermenu").animate({width:'1000px'}, 500);
}
});
asked 1 min ago
Jquery animation hangs when user scrolls up and down too fast
Aucun commentaire:
Enregistrer un commentaire