【问题标题】:Combine the use of velocity.js' slideUp and begin: function结合使用velocity.js的slideUp和begin:函数
【发布时间】:2015-06-16 14:32:54
【问题描述】:

你如何将这两者结合起来,让一个项目可以向上滑动,但在动画开始时触发一些 JS。

上滑代码

 .velocity("slideUp", { delay: 500, duration: 1500 });

开始:代码

$element.velocity({
    opacity: 0
}, { 
    /* Log all the animated divs. */
    begin: function(elements) { console.log(elements); }
});

这样做是行不通的。

.velocity("slideUp", { delay: 500, duration: 1500 }), { 
    /* Log all the animated divs. */
    begin: function(elements) { console.log(elements); }
});

【问题讨论】:

    标签: javascript velocity.js


    【解决方案1】:

    您必须将begin 属性放在选项对象中:

    .velocity("slideUp", {
        delay: 500, duration: 150,
        begin: function(elements) { console.log(elements); }
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-06-23
      • 2016-09-12
      • 2014-06-20
      • 2020-03-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多