Created
May 27, 2014 07:58
-
-
Save Lif3line/2c328ca20fb021f44d1e to your computer and use it in GitHub Desktop.
Static toggling function for a single element - could be a button, sliding panel etc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toggle() { | |
if($('#toggleElement').data("toggledOn")) { // Turn off | |
$('#toggleElement').data("toggledOn",false); | |
/* Do something */ | |
} else { // Turn on | |
$('#toggleElement').data("toggledOn",true); | |
/* Do something */ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment