Using Bower:
bower install bsp-utils
Manually:
- Download jQuery 1.7.0 or above
- Download bsp-utils.js
bsp_utils.onDomInsert(String selector, Object callbacks)
Triggers the given callbacks
when an element matching the given selector
is inserted into the DOM. The callbacks
argument can contain:
Function(Array or HTMLElement items) beforeInsert
Function(HTMLElement item) insert
Function(Array or HTMLElement items) afterInsert
This method is most often used to implement a plugin that works like a Web Component (demo).
See the separate plugin documentation.
bsp_utils.throttle(Number interval, Function throttledFunction)
Throttles the given throttledFunction
so that it executes at most given interval
(in milliseconds). This method is most often used to rate-limit noisy events like scroll
(demo).