在Finish处理程序上的Polymer Core Animation势在必行

时间:2014-09-17 18:04:20

标签: polymer

  var animation = new CoreAnimation();
  animation.duration = 500;
  animation.keyframes = [ {opacity: "1"},{opacity: "0"}];
  animation.target = self.myElement;
  animation.play();

如何抓住结局事件?

    self.myElement.addEventListener('core-animation-finish', function(e) {
              console.log('finish!');
    });

1 个答案:

答案 0 :(得分:3)

这解决了我的问题:

 var animation = new CoreAnimation();
  animation.duration = 500;
  animation.keyframes = [ {opacity: "1"},{opacity: "0"}];
  animation.target = this.$.myElement;
  animation.play();

animation.addEventListener('core-animation-finish', function(e) {
              console.log('finish!');
 });