Skip to content Skip to sidebar Skip to footer

Get The Element That Was Collapsed On Hidden/shown.bs.collapse

I'm working on an ASP.NET MVC application, making it completely by myself, learning as I do it. I am making a sidebar menu and I'm stuck trying to make an animated up/down arrow. C

Solution 1:

simply target current element child you will find .glyphicon and use JQuery toggleClass() on it

form example

$('[data-toggle="collapse"]').click(function(){
    $(this).children(".glyphicon").toggleClass("glyphicon-arrow-down glyphicon-arrow-up")
});

working fiddle

Post a Comment for "Get The Element That Was Collapsed On Hidden/shown.bs.collapse"