🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

lightSwitch is a lightweight jQuery plugin which convert the standard checkbox into a stylish animated toggle switch.

Checkbox Switch

Documentation

lightSwitch

Hi! I'm a light switch designed with a little bit of CSS3 and jQuery. Use me, I'm nice, animated and f***ing light !

Example of lightSwitch

How to use me?

Installation

First, you need to add two good librairies in your HTML code :

HTML

Create a checkbox with the lightSwitch class :

<input type="checkbox" name="light" class="lightSwitch" />

jQuery

Then call the lightSwitch function on this checkbox to create me :

$('.lightSwitch').lightSwitch();

Add a callback function

You can use me to call a function when I'm ON or OFF. To do this, add options brackets in the call of the lightSwith function :

$('.lightSwitch').lightSwitch({ 	on_callback: function_when_im_on, 	off_callback: function_when_im_off });

One more thing

You can watch this in the example.html file 😜 Have fun !

License

This plugin is available under the MIT license.

Thanks to...

Follow me on Twitter !


You May Also Like