Provide an option to enable trailing execution of the callback. This is the way jQuery throttle / debounce implemented it.
I cannot use your plugin. I have a Back-to-Top-Button which should disappear when window.scrollTop() is above 500px or so. So if the user scrolls quite fast, there will be no execution in the top 500px area and the button won't disappear.
this was the first thing i looked for when i peeked at the code. i was considering this implementation until i saw it was missing the trailing execution. for typical cases i'd expect it to be the default.
Provide an option to enable trailing execution of the callback. This is the way jQuery throttle / debounce implemented it.
I cannot use your plugin. I have a Back-to-Top-Button which should disappear when window.scrollTop() is above 500px or so. So if the user scrolls quite fast, there will be no execution in the top 500px area and the button won't disappear.