Sha256: cd78a14f12c6f5b6d07f1bc5bed8abe651b531bd7da932869224dbdb7c3e9759
Contents?: true
Size: 646 Bytes
Versions: 6
Compression:
Stored size: 646 Bytes
Contents
var toggleHandler = function(toggle) { var toggle = toggle; var radio = $(toggle).find("input"); var checkToggleState = function() { if (radio.eq(0).is(":checked")) { $(toggle).removeClass("toggle-off"); } else { $(toggle).addClass("toggle-off"); } }; checkToggleState(); radio.eq(0).click(function() { $(toggle).toggleClass("toggle-off"); }); radio.eq(1).click(function() { $(toggle).toggleClass("toggle-off"); }); }; $(document).ready(function() { $(".toggle").each(function(index, toggle) { toggleHandler(toggle); }); });
Version data entries
6 entries across 6 versions & 4 rubygems