jQuery bind/unbind 'scroll' event on $(window)
$(window).unbind('scroll');
Even though the documentation says it will remove all event handlers if called with no arguments, it is worth giving a try explicitly unbinding it.
Update
It worked if you used single quotes? That doesn't sound right - as far as I know, JavaScript treats single and double quotes the same (unlike some other languages like PHP and C).
Note that the answers that suggest using unbind()
are now out of date as that method has been deprecated and will be removed in future versions of jQuery.
As of jQuery 3.0, .unbind() has been deprecated. It was superseded by the .off() method since jQuery 1.7, so its use was already discouraged.
Instead, you should now use off()
:
$(window).off('scroll');