Skip to content

essanousy/jToggler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jToggler

jQuery toggler plugin

Simple jQuery plugin that generate toggle switcher from checkboxes.

At first, include jtoggler.js and jtoggler.styles.css in project.

You must use class name jtoggler for checkboxes: <input type="checkbox" class="jtoggler">

For initialization use:

$('.jtoggler').jtoggler();

For using labels add to input data-attribute: data-jtlabel="Your text label". If You need changeable label add data-jtlabel-success="Toggler on label".

If You want to use three-state toggler just add data-jtmulti-state attribute to checkbox. If You want use it with disabled add disabled attribute to checkbox. for Multistate : To specify wich State you want add data-jtmulti-index='2' for exemple

If you add new toggler to DOM you must run init() to reinit items.

Events

After toggling on document object triggered event jt:toggled with additional parameter named target.

After toggling 3-state on document object triggered event jt:toggled:multi with additional parameter named target.

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 61.6%
  • HTML 19.6%
  • CSS 18.8%