jQuery判断动画是否执行完成

JS

$(function() {
  $("#myDiv").bind("click", function() {
    if ($(this).css("transform") == 'none') {
      $(this).css("transform", "scale(1.5, 1.5)");
    } else {
      $(this).css("transform", "");
    }
  })

  $("#myDiv").on("webkitTransitionEnd msTransitionend mozTransitionend transitionend", function() {
    alert(1);
  });

});

CSS

div{
   100px;
  height: 100px;
  background:red;
  transition: all 1s ease-in-out .5s;
  margin: 100px auto;
  
}

HTML

<div id="myDiv">
  
</div>

CodeOpen代码:

jQuery判断动画是否执行完成

原文地址:https://www.cnblogs.com/sunhk/p/4790800.html