jamiebicknell/Toggle-Switch — pull request #3 by steve228uk (2012-11-21 13:11:34+00:00)
Title: Consider switching to jQuery plugin

It might be an idea to switch the code to a plugin for easy syntax. I've done it here, it checked to see if the input is pre-checked or not and then sets the state.

You just need to bind it to your inputs

$('input[type=checkbox]').toggleSwitch();

And that's it! There's an option to change the value it slides if the user wants to change the image for example. Other than that everything should work as before except the only thing the user needs to put in the markup is

Should JS be disabled in the browser the plugin will die gracefully and fallback to the browser default checkbox.