limit.js icon indicating copy to clipboard operation
limit.js copied to clipboard

Add trailing execution

Open vuhrmeister opened this issue 10 years ago • 1 comments

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.

vuhrmeister avatar Oct 26 '15 13:10 vuhrmeister

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.

mdeanda avatar Mar 30 '17 22:03 mdeanda