I use the glyphicon-triangle-left and glyphicon-triangle-bottom bootstrap glyphicons in the soundtrack. When you open a div, it shows bottom one, and when you close it, it shows left one.
When the icon switcher classes look a little silly, so I want to create a transition, it is possible for the icon to rotate or disappear. But I'm not sure how to do this, as I switch between classes via jQuery as follows:
function toggleChevron(e) { jQuery(e.target) .prev('.panel-heading') .find("i.indicator") .toggleClass('glyphicon-triangle-bottom glyphicon-triangle-left'); }
I am not sure how to do this because it uses classes from the soundtrack, etc.
I tried doing something like this in my css file, but that does not do what I want: p
.glyphicon-triangle-bottom{ opacity: 0; transition: opacity 1s; } .glyphicon-triangle-left{ opacity: 1; transition: opacity 1s; }
Did anyone know how I can make icon transitions? Thank you very much in advance!
EDIT: I tweaked this code a bit, but this is a good idea of ββwhat my accordion looks like: http://jsfiddle.net/zessx/r6eaw/12/
source share