Last active
March 11, 2016 15:01
-
-
Save v-skochko/0bf0d893530bf708fa94 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| var accordionHeader = $('.faq_title'), | |
| accordionContent = $('.description'); | |
| $(accordionHeader).click(function () { | |
| if ($(this).hasClass('is-active')){ | |
| $(this).next(accordionContent).slideUp('fast'); | |
| $(this).removeClass('is-active'); | |
| } | |
| else { | |
| $(".faq_title span").html('+'); | |
| // close other content | |
| $(accordionHeader).not(this).next(accordionContent).slideUp('fast'); | |
| $(accordionHeader).not(this).removeClass('is-active'); | |
| $(this).next(accordionContent).slideDown('fast'); | |
| $(this).addClass('is-active'); | |
| $(this).find('span').html('-'); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment