Skip to content

Instantly share code, notes, and snippets.

@lachlanjc
Created November 4, 2016 16:55
Show Gist options
  • Save lachlanjc/0203c5f6580ef8f55775d46f513442f6 to your computer and use it in GitHub Desktop.
Save lachlanjc/0203c5f6580ef8f55775d46f513442f6 to your computer and use it in GitHub Desktop.
For when you need an element to be hidden on page load, but respond to jQuery's .show() or .toggle() later, use Rehide.
$(document).ready ->
# Assuming .hidden sets display: none
$('[data-behavior~=rehide]').hide().removeClass('hidden')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment