eventPause is a tiny plugin with lots of methods to control events. So whenever you want you can pause and activate any event.
jQuery gave us many way to bind events and unbind it.
But there some situation comes where we just want to pause event (or say unbind it temporally). For that we unbind events and bind it again when we need.
But this become painful on binding event again when there is no reference of event handler or you don’t have its scope, or you just don’t know what event handlers are assigned to a particular event.
Method | Description |
pause | Pause an event or group of event of element . |
active | Active events of a element. |
pauseChild | Pause events of that element along with events of all its descendants elements. |
activeChild | Active events of that element along with events of all its descendants elements. |
toggle | toggle the current state of a element (active to paused , paused to active) |
enable | Enable the element to change the current state. (does not accept second argument) |
disable | Disbale the element to change the current state.(does not accept second argument) |
state | Give current state of element. It will return four combination ex: paused-enabled means event is paused and state change in enabled. (does not accept second argument) |
Method | Description |
activeAll | Active all elements which are paused using eventPause plugin. |
enableAll | Enable all the element(in which eventpause plugin is used) to chnage the current state. |
disableAll | Disable all the element(in which eventpause plugin is used) to chnage the current state. |
Calling without any parameter.
$('.selector').eventPause();
Calling with only event list
$('.selector').eventPause('click hover');
Calling with only method
$('.selector').eventPause('pause');
**Other method are also called in same way.
Calling with method and event list
$('.selector').eventPause('pause','click hover');
** enable,disable and state method does not accept second argument.