-
-
Save zdimaz/87441d2993e66f65af89d74be42d33ae to your computer and use it in GitHub Desktop.
js accordion
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
/** | |
** nextOpen | |
**/ | |
accordion: function(){ | |
var self = this; | |
$(".set > a").on("click", function(){ | |
if($(this).hasClass('active')) { | |
$(this).removeClass("active"); | |
$(this).siblings('.accordion_content').slideUp(200); | |
$(".set > a i").removeClass("fa-angle-down").addClass("fa-angle-right"); | |
} | |
else { | |
$(".set > a i").removeClass("fa-angle-down").addClass("fa-angle-right"); | |
$(this).find("i").removeClass("fa-angle-right").addClass("fa-angle-down"); | |
$(".set > a").removeClass("active"); | |
$(this).addClass("active"); | |
$('.accordion_content').slideUp(200); | |
$(this).siblings('.accordion_content').slideDown(200); | |
} | |
}); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment