animateManage.js

;(function(window,document,undefined){

var 
    _aniQueue = [],             //动画队列 --- ani:动画,Queue:队列
    _baseUID = 0,               //元素的UID基础值
    _aniUpdateTimer = 13,       //动画更新的时间
    _aniID = -1,                        //检测的进程ID
    isTicking = false;                  //检测状态

    /*
    * optios 参数
    * context --- 被操作的元素上下文
    * effect  --- !动画效果的算法 !
    * time    ---      效果的持续时间
    * starCss --- 元素的起始偏移量
    * css     --- 元素的结束值偏移量
    * */

window.animateManage = function( optios ){
    this.content = optios;          //当前对象
}

animateManage.prototype = {      //prototype 属性使您有能力向对象添加属性和方法
    //初始化方法
    init : function(){
        this.start(this.content);
    },

    //停止动画
    stop : function(_e){
        clearInterval(_aniID);
        isTicking = false;
    },

    //开始动画
    start : function(optios){
        if(optios)
            this.pushQueue(optios);         //填充队列属性
        if(isTicking || _aniQueue.length === 0)
            return false;
        this.tick();
        return true;
    },

}

})

 

相关文章:

  • 2021-06-19
  • 2022-01-08
  • 2022-03-04
  • 2021-08-29
  • 2021-07-04
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-01
  • 2021-08-02
  • 2022-01-01
  • 2022-12-23
  • 2021-09-10
  • 2022-12-23
  • 2021-07-10
相关资源
相似解决方案