Skip to content

Instantly share code, notes, and snippets.

@spdustin
Created July 18, 2012 16:38
Show Gist options
  • Save spdustin/3137350 to your computer and use it in GitHub Desktop.
Save spdustin/3137350 to your computer and use it in GitHub Desktop.
FAQs toggler final
$('dl.faq > dt')
.on(
'click',
function() {
$(this)
.toggleClass('closed opened')
.next()
.toggle();
}
)
.addClass('closed')
.next()
.hide()
;
$('.noscript').show();
$('#expandfaq')
.on(
'click',
function() {
$('dl.faq > dt')
.removeClass('closed')
.addClass('opened')
.next()
.show();
}
)
;
$('#closefaq')
.on(
'click',
function() {
$('dl.faq > dt')
.removeClass('opened')
.addClass('closed')
.next()
.hide();
}
)
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment