2

我有以下代码,无论出于何种原因,我的 end 选项似乎不想调用它应该调用的函数。有任何想法吗?

$(document).ready(function() {
    $('#weareepic').cycle({ 
        fx:      'fade', 
        speed:    1000, 
        timeout:  1500,
        nowrap: 1,
        end: function() {
            $('#bigshots').fadeout(1500);
        }
    });
});

非常感谢各位!

4

2 回答 2

1

'fadeout' 应该是驼峰式的'fadeOut'。

由于被 jquery 捕获,jquery ajax 调用中的 Javascript 错误可以被隐藏。如果出现问题,我建议使用调试器。

于 2013-04-25T13:42:17.503 回答
0

您必须结合使用endautostop否则您的end回调函数将不会被调用:

$(document).ready(function() {
    $('#weareepic').cycle({ 
        fx:      'fade', 
        speed:    1000, 
        timeout:  1500,
        nowrap: 1,
        autostop: true,
        end: function() {
            $('#bigshots').fadeOut(1500);
        }
    });
});

然后,您可以从结束回调函数重新启动循环。

于 2013-04-25T13:42:34.783 回答