how to wait for css transition to finish before applying next class

前端 未结 3 420
死守一世寂寞
死守一世寂寞 2021-01-03 19:27

I\'m trying to get text to \"swing\", by applying a rotation transition one way, followed by a rotation the next way, when hovered over. However, it doesn\'t wait for the fi

3条回答
  •  渐次进展
    2021-01-03 19:53

    Each browser has its own event that you can use to detect transition end, just bind like this :

    $(".yourClass").on('transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd', 
        function() {
             //doSomething
        });
    

提交回复
热议问题