Last active
December 21, 2015 10:09
-
-
Save dustintheweb/6290183 to your computer and use it in GitHub Desktop.
jQuery Replacement Syntax for Depreciated Toggle Function
This file contains hidden or 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
$('#element').click(function() { | |
if ($(this).data('clicked')) { | |
$(this).css({'display': 'block'}); | |
$(this).data('clicked', false); | |
} else { | |
$(this).css({'display': 'none'}); | |
$(this).data('clicked', true); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment