Web前端之路前端开发那些事首页投稿(暂停使用,暂停投稿)

移动端动画库的设计与实现

2016-12-12  本文已影响245人  smartLife

Usage

测试case

查看百度脑图附件

测试页面

见demo

设计目的

案例

    animate(propDomCallbackBtn1, {
        width: "70%"
    }, {
      duration: 1000,
      easing: "ease",
      cb: function () {
          console.log("串行1");
      }
    })
    .animate(propDomCallbackBtn2, {
        height: 200
    }, {
      duration: 3000,
      easing: "ease",
      cb: function () {
          console.log("串行2");
      }
    });
    animate(propDomCallbackBtn1, {
        width: "70%"
    }, {
      duration: 1000,
      easing: "ease",
      delay: 2000,
      isAsync: 1
      cb: function () {
          console.log("并行1");
      }
    })
    .animate(propDomCallbackBtn2, {
        height: 200
    }, {
      duration: 3000,
      easing: "ease",
      isAsync: 1
      cb: function () {
          console.log("并行2");
      }
    })
    .endAnimaion(function() {
        console.log("并行动画全部执行完成");
    });
    animate(propDomCallbackBtn1, {
        width: "70%"
    }, {
      duration: 1000,
      easing: "ease",
      isAsync: 1
      cb: function () {
          console.log("并行1");
      }
    })
    .animate(propDomCallbackBtn2, {
        height: 200
    }, {
      duration: 3000,
      easing: "ease",
      isAsync: 1
      cb: function () {
          console.log("并行2");
      }
    })
    .start(function() {
        console.log("并行动画全部执行完成");
    })
    .animate(propDomCallbackBtn2, {
        height: 200
    }, {
      duration: 3000,
      easing: "ease",
      cb: function () {
          console.log("串行1");
      }
    });
    animate(propDomCallbackBtn1, {
        width: "70%"
    }, {
      duration: 1000,
      easing: "ease",
      delay: 2000,
      isAsync: 1,
      cb: function () {
          console.log("串行1");
      }
    })
    .animate(propDomCallbackBtn1, {
        height: 200
    }, {
      duration: 3000,
      easing: "ease",
      isAsync: 1,
      cb: function () {
          console.log("串行1");
      }
    })
    .start(function() {
        console.log("并行动画全部执行完成1");
    });

    animate(propDomCallbackBtn2, {
        width: "70%"
    }, {
      duration: 1000,
      easing: "ease",
      delay: 2000,
      isAsync: 1,
      cb: function () {
          console.log("并行3");
      }
    })
    .animate(propDomCallbackBtn2, {
        height: 200
    }, {
      duration: 3000,
      easing: "ease",
      isAsync: 1,
      cb: function () {
          console.log("并行4");
      }
    })
    .start(function() {
        console.log("并行动画全部执行完成2");
    });

参数

注意点

设计方案概述

详细设计方案

设计注意点

License

MIT License

上一篇 下一篇

猜你喜欢

热点阅读