Giter VIP home page Giter VIP logo

eventpause.js's Introduction

eventPause.js

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.

So this plugin will help you there and will give control on events in better way.

Demo :http://ignitersworld.com/lab/eventPause.html


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.


eventPause accept two parameter 1st method and 2nd events(multiple event space seperated) where both or optional. We will see some combination of way in which we can use this plugin.

Plugin Methods Example


Calling without any parameter.

  $('.selector').eventPause();
  
It will activate pause mode for all events of selector.

Calling with only event list

  $('.selector').eventPause('click hover');
  
It will activate toggle mode for click and hover event.

Calling with only method

  $('.selector').eventPause('pause');
  
It will activate pause mode for all events of selector.
**Other method are also called in same way.

Calling with method and event list


    $('.selector').eventPause('pause','click hover');
   
It will activate pause mode for click and hover event.
** enable,disable and state method does not accept second argument.

Global methods example


Calling global method

  $.event.activeAll();
  
Global method does not accept any argument.

eventpause.js's People

Contributors

s-yadav avatar

Watchers

Yashi Lanka avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.