Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Adding active class dynamically when open accordion panel item

Adding active class dynamically to open accordion panel item.

Script:

$('.accordion-panel .panel-heading').removeClass("actives");

//Accordian color change and proper toggle 
$('.accordion-panel .panel-heading a').click(function (e) {
        $this = $(this).parents(".panel-heading");
if($this.next().hasClass("in"))
{
$this.removeClass('actives');
}
else
{
$this.addClass('actives');
}

        $this.parent(".panel").siblings().find(".panel-collapse").removeClass("in");
        $this.parent().siblings().each(function(){
                $(this).find(".panel-heading").removeClass('actives');
        }) 

});


This post first appeared on PSD-HTML-CSS-JS, please read the originial post: here

Share the post

Adding active class dynamically when open accordion panel item

×

Subscribe to Psd-html-css-js

Get updates delivered right to your inbox!

Thank you for your subscription

×