Skip to content

Instantly share code, notes, and snippets.

@procload
Created March 13, 2014 17:46
Show Gist options
  • Save procload/9533267 to your computer and use it in GitHub Desktop.
Save procload/9533267 to your computer and use it in GitHub Desktop.
# Hide/Show Collapsible Content Sections
$('.collapsible-content-header').on 'click', (e) ->
e.preventDefault()
$this = $(this)
$container = $($(this).closest('.collapsible-content'))
$icon = $($container.find("i"))
if $container.hasClass('body-is-showing')
$container.removeClass('body-is-showing')
$icon.removeClass('icon-minus').addClass('icon-plus')
else
$container.addClass('body-is-showing')
$icon.removeClass('icon-plus').addClass('icon-minus')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment