This project is archived and is in readonly mode.

#1216 ✓invalid
ronin-133141 (at lighthouseapp)

window.removeEvent('scroll:throttle, function) doesn't remove event handlers after the first

Reported by ronin-133141 (at lighthouseapp) | April 27th, 2011 @ 07:15 PM

I'm trying to execute some functions just once, after I've scrolled to certain positions on the page. So I'm doing this by invoking the function onScroll and then detaching the event handler within the same function:

http://jsfiddle.net/cmhVV/

Note that onScrollA and onScrollB are identically attached to and detached from window "scroll:throttle". On first scroll, both "onScrollA" and "onScrollB" correctly gets logged. On subsequent scrolls though, "onScrollB" continues to be logged, which is incorrect.

It appears that if there are more than one scroll:throttle events attached to window, only the first attached event handler successfully gets removed but not the rest.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Pages