Created
February 1, 2013 12:55
-
-
Save JensRantil/4691153 to your computer and use it in GitHub Desktop.
Make it possible to style `a.accordion-toggle`-links based on whether the Bootstrap collapse/accordion item is collapsed or not. The CSS-class "active" means that a `accordion-group` is open, the lack of it means it's closed. If it wasn't for the fact that the `.collapsed` class is not added initially to a collapsed `a.accordion-toggle` element,…
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
jQuery.ready(function() { | |
$('.accordion').on('hide', function(e) { | |
$(e.target).parent().find('.accordion-toggle').first().removeClass('active'); | |
}).on('show', function(e) { | |
$(e.target).parent().find('.accordion-toggle').first().addClass('active'); | |
}); | |
}) |
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
.accordion .accordion-toggle.active { | |
font-weight: bold; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment