【问题标题】:Jquery Waypoints : Multiple functions not workingJquery Waypoints:多个功能不起作用
【发布时间】:2015-02-13 22:07:37
【问题描述】:

我只能说我在测试航路点,一旦我添加了第二个函数,第一个函数就不再起作用了。这是为什么呢?

$(document).ready(function() {
$(".black").waypoint(function(){
    TweenMax.to(this, 2, {right:"0", ease:Power2.easeInOut})       
},{offset:'50%'});

$(".white").waypoint(function(){
    TweenMax.to(this, 2, {left:"0", ease:Power2.easeInOut})       
},{offset:'50%'});

});

【问题讨论】:

  • 您使用的是哪个版本的 jQuery Waypoints?

标签: javascript jquery jquery-waypoints


【解决方案1】:

试试下面的。我会很好奇日志是否会多次显示其调用但 TweenMax 无法执行多次。

$(document).ready(function() {
$(".black").waypoint(function(direction){
    console.log('BLACK');
    TweenMax.to(this, 2, {right:"0", ease:Power2.easeInOut})       
},{offset:'50%'});

$(".white").waypoint(function(direction){
    console.log('WHITE');
    TweenMax.to(this, 2, {left:"0", ease:Power2.easeInOut})       
},{offset:'50%'});

});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-31
    • 2014-08-24
    • 2018-11-19
    • 2013-10-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多