Documentation does not explain how do I use them either. I mean, they look really fancy. But how do I actually use them in my app? Where do I read the attribute if the switch is switched or not? If it is there and I just cannot see it, documentation (website demo) should explain it.
Thank you for your work and have a good day!
It's just a normal checkbox: http://codepen.io/anon/pen/eNQMOL
Came up with something that might help:
//Set Function To Check Element has color applied for being toggled on
function is_toggled(){
if ($('.switch label input[type=checkbox]:checked + .lever').css('color')) {
//Perform Action as it is toggled on
} else {
//Perform action when toggled off
}
}
//Set listener
$(document).on({
'mouseup':function (e) {if (e.which == 1) {is_toggled()}},
'keyup':function (e) {if (e.which == 32) {is_toggled()}}
}, '#Toggle_Div');
Most helpful comment
It's just a normal checkbox: http://codepen.io/anon/pen/eNQMOL