Created
July 18, 2012 16:38
-
-
Save spdustin/3137350 to your computer and use it in GitHub Desktop.
FAQs toggler final
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('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