jquery.defer
jquery.defer copied to clipboard
A pair of utility methods for forcing a function or an object's methods to wait for a deferred object to resolve before running (and then undoing this effect if required).
jquery.defer / jquery.undefer
A pair of utility methods for forcing a function or an object's methods to wait for a deferred object to resolve before running and undoing this effect if required.
Getting Started
Download the production version or the development version.
In your web page:
html
<script src="jquery.js"></script>
<script src="dist/defer.min.js"></script>
<script>
jQuery(function($) {
$.defer(object, deferredObject, options);
$.undefer(object, options);
});
</script>
Documentation
See the source code for documentation
Examples
To implement the lazy loaded google maps that inspired this plugin the individually rewritten methods can be replaced by (using the same object and function names as in the original article)
$.defer(GoogleMaps.prototype, _mapsLoaded, {exclude: 'init'});
Release History
- v0.1.0 First iteration of plugin, carrying out basic defer and undefer actions