jQuery throttle / debounce v1.1
While this plugin was initially one of my jQuery Misc plugins, it seemed useful enough to “promote” to its own project page. Congratulations jQuery throttle / debounce, you’ve “made it big!”
That being said, jQuery throttle / debounce allows you to rate-limit your functions in multiple useful ways. Passing a delay and callback to $.throttle
returns a new function that will execute no more than once every delay
milliseconds. Passing a delay and callback to $.debounce
returns a new function that will execute only once, coalescing multiple sequential calls into a single execution at either the very beginning or end.
Just take a look at the project page to see more explanations (both textual and visual), documentation and working examples!
If you have any feedback or suggestions, please leave them in the comments, and if you find this plugin useful, please donate!
a
,b
,i
,br
,p
,strong
,em
,pre
,code
.<pre class="brush:js"></pre>
(supported syntax highlighting brushes:
js
,css
,php
,plain
,bash
,ruby
,html
,xml
)<
instead of<
and>
instead of>
in the examples themselves.