Checkbox Based Sliding Switch - jQuery simpleToggler

File Size: 7.47 KB
Views Total: 8826
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Checkbox Based Sliding Switch - jQuery simpleToggler

simpleToggler is a lightweight jQuery plugin that transforms the normal checkbox inputs into animated, easy-to-custom toggle switches. Works on modern browsers which support CSS transitions.

How to use it:

1. Load the style sheet ui-toggle.css for the default CSS styles of your toggle switches.

<link rel="stylesheet" href="css/ui-toggle.css">

2. Load the latest jQuery library and jQuery simpleToggler plugin at the end of your html document.

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" 
        integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" 
        crossorigin="anonymous"></script>
<script src="js/jquery.toggler.js"></script>

3. Call the function on the checkbox input.

$('#yourCheckbox').checkToggler();

4. Into...

<input id="yourCheckbo" type="checkbox" class="checkbox ui-stoggle--hidden">
<div class="ui-stoggle on">
  <div class="ui-stoggle--inner">
    <span class="ui-stoggle--label-on"><i class="ui-stoggle--label-text">On</i></span>
    <span class="ui-stoggle--label-off"><i class="ui-stoggle--label-text">Off</i></span>
  </div>
  <span class="ui-stoggle--slider"><i></i></span>
</div>

5. Customize the label text.

$('#yourCheckbox').checkToggler({
  
  labelOn: "jQuery",
  labelOff: "Script"

});

This awesome jQuery plugin is developed by JN0iZzze. For more Advanced Usages, please check the demo page or visit the official website.