Submit your widget

jquery.bouncer - Defers event handler until a duration has lapsed or a given event has occurred.

Created 4 years ago   Views 1373   downloads 610    Author jtwalters
View DemoDownload
15
Share |

jQuery Bouncer

Defers event handler until a duration has lapsed or a given event has occurred.

Download the latest release on the release page.

<script src="jquery.js"></script>
<script src="dist/jquery.bouncer.min.js"></script>
<script>
jQuery(function($) {
  $('.selector').bouncer({
    // Options object. All optional. Defaults described below. 
    wait: 5000, // wait up to X milliseconds
    events: 'click.bouncer', // e.g. defer click event with bouncer namespace
    activeClass: 'is-processing', // add .is-processing class while pending
    resolveEvent: 'bouncer:resolve', // trigger a resolve event to resolve immediately
    rejectEvent: 'bouncer:reject' // trigger a reject event to reject immediately
  });
});
</script> 

Provides an AMD and CommonJS/Browserify module loader along with a standard script include loader.

// Returns a function which you can pass a reference to your jQuery to. 
var $ = require('jquery');
require('jquery.bouncer')($);

(More soon)

(Coming soon)

  • 1.0.0-alpha — first release to the public.