Last active
December 24, 2015 02:59
-
-
Save eupharis/6734086 to your computer and use it in GitHub Desktop.
Bootstrap Accordion Icon Switch
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
/* | |
Updates An Accordion's Icon. | |
Just include: | |
<span class="accordion-icon">+</span> | |
To your accordion-toggle! | |
*/ | |
"use strict"; | |
$(function() { | |
var accordion_body = $(".accordion-body"); | |
accordion_body.on("show",function(event){ | |
var accordion_toggle_icon = $(this).parent('.accordion-group').find('.accordion-icon'); | |
accordion_toggle_icon.text('-'); | |
}); | |
accordion_body.on("hide",function(event){ | |
var accordion_toggle_icon = $(this).parent('.accordion-group').find('.accordion-icon'); | |
accordion_toggle_icon.text('+'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment