how to listen to the end of a bootstrap animation

后端 未结 4 1065
暗喜
暗喜 2020-12-18 05:21

I\'m developing a website using bootstrap and its responsive JS+CSS.

At the top of the page I have a fixed navigation bar where an \"expand menu\" button is shown in

4条回答
  •  北海茫月
    2020-12-18 05:58

    If you use bootstrap and transitions (css3 transition) you can try this:

    $("body").on($.support.transition.end, '#main-navbar .nav-collapse', function(event){    
        console.log("end of the animation");
    });
    

    $.support.transition.end contains one of these events: webkitTransitionEnd, transitionend, oTransitionEnd otransitionend, transitionend.

    But if you use css3 animation (css3 animation-name and keyframes) you can try this:

    $("body").on('webkitAnimationEnd oanimationend msAnimationEnd animationend', '#main-navbar .nav-collapse', function(event){    
        console.log("end of the animation");
    });
    

提交回复
热议问题