JS-图片控制-动画管理模块

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;
    },

}

})

 

转载于:https://www.cnblogs.com/zhangchaoran/p/7264125.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值