I have this function which fades in a main menu when scrolled more than 100px.
$(document).ready(function() {
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
$('#main_nav_fixed').fadeIn(500);
} else {
$('#main_nav_fixed').fadeOut(500);
}
});
});
It works fine, but if the user scrolls fast up and down lets say 10 times, and goes to the top of the screen, the menu fades in and out according to times scrolled more than 1oopx down.
How do I add the .stop function to that so that it will not que animations but only do one at the time, anyone?
Regards, Klemme