Get the element that was collapsed on hidden/shown.bs.collapse

后端 未结 1 1967
日久生厌
日久生厌 2021-01-27 14:05

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 arr

相关标签:
1条回答
  • 2021-01-27 14:53

    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

    0 讨论(0)
提交回复
热议问题