小程序动画-循环放大缩小的动画(一闪一闪的)

var circleCount = 0;  
      // 心跳的外框动画  
      this.animationMiddleHeaderItem = wx.createAnimation({  
        duration:1000,    // 以毫秒为单位  
        timingFunction: 'linear',  
        delay: 100,  
        transformOrigin: '50% 50%',  
        success: function (res) {  
        }  
      });  
      setInterval(function() {  
        if (circleCount % 2 == 0) {  
          this.animationMiddleHeaderItem.scale(1.15).step();  
        } else {  
          this.animationMiddleHeaderItem.scale(1.0).step();  
        }  
          
        this.setData({  
          animationMiddleHeaderItem: this.animationMiddleHeaderItem.export()  //输出动画
        });  
          
        circleCount++;  
        if (circleCount == 1000) {  
          circleCount = 0;  
        }  
      }.bind(this), 1000);  

你可能感兴趣的:(小程序)