jquery-wait
Description
It's a small jQuery plugin that with one call
- add/remove class(es)
- it can also delay adding classes so wait only appears if your app is slow.
- disable/enable your control
- let you know if a current element is 'waiting'
- call functions before/after waiting
Usage
Simple
//by default adds the class 'wait', adds the attribute 'disabled'; data'waiting'; //true //removes added class(es), removes 'disabled'; data'waiting'; //undefined
With configuration
You can configure your .wait calls either before hand, or only when you want to use .wait
;
You can add the property .set:'on', to the above configuration, and the wait will activate immediately
With delay
An example of triggering wait with a small delay
//immediately disables the control, but waits 500ms for everything else; //if this this is called 400ms later. Control is enabled, non of the 'on' operations are run;