• 博客园logo
  • 会员
  • 周边
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
成为自己最想成为的那种人
博客园    首页    新随笔    联系   管理    订阅  订阅
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;
    },

}

})

 

posted on 2017-07-31 17:08  遇见未来  阅读(437)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3