$(window).scroll() firing on page load

Viewed 17799

Is there a way to prevent $(window).scroll() from firing on page load?

Testing the following code in Firefox 4, it fires even when I unplug the mouse.

jQuery(document).ready(function($){    
$(window).scroll(function(){
                console.log("Scroll Fired");
    });
});
5 Answers

This seems to have worked for me.

$(window).bind("load", function() {
    $(window).on("scroll", function () {
        console.log('scroll');
    });
});
Related