I would like to add an asset on the accordion title?
Add class active
?
$(document).ready(function() {
$(".accordion .accord-header").click(function() {
if($(this).next("div").is(":visible")){
$(this).next("div").slideUp("slow");
} else {
$(".accordion .accord-content").slideUp("slow");
$(this).next("div").slideToggle("slow");
}
});
$(".accordion .accord-header:eq(1)").trigger('click');
});
Just insert this code before or after your if-else-query:
$('.accord-header.active').removeClass('active');
$(this).addClass('active');
Here's a fiddle: http://jsfiddle.net/Niffler/ngGqA/17/
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments