Skip to content

Instantly share code, notes, and snippets.

@PikachuEXE
Created April 26, 2013 05:01
Show Gist options
  • Save PikachuEXE/5465122 to your computer and use it in GitHub Desktop.
Save PikachuEXE/5465122 to your computer and use it in GitHub Desktop.
Toggleable Just a small style and a script file to toggle display content (on/off)
jQuery ($) ->
$(document).on "click", '.js-toggleable-container', ->
$(this).toggleClass("is-toggled")
.js-toggleable-container {
& > .js-toggleable-content.on-toggled {
display: none;
}
&.is-toggled {
// Hide the default one
& > .js-toggleable-content {
display: none;
}
// Display the hover one
& > .js-toggleable-content.on-toggled {
display: inherit;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment