Skip to content

Instantly share code, notes, and snippets.

@dustintheweb
Last active December 21, 2015 10:09
Show Gist options
  • Save dustintheweb/6290183 to your computer and use it in GitHub Desktop.
Save dustintheweb/6290183 to your computer and use it in GitHub Desktop.
jQuery Replacement Syntax for Depreciated Toggle Function
$('#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