jquery循环函数参数

发布于 2024-12-29 05:13:58 字数 895 浏览 0 评论 0原文

在下面的示例中,我如何提及第二种情况下的速度或至少使其立即工作 $container.cycle(i, manualEffects[i]);

另外,如果我提到effect = none。它不起作用

$(function() { 
    var $bc = $('#buttonContainer'); 

    var $container = $('#container').cycle({ 
        fx: 'scrollLeft', 
        speed: 300, 
        autostop: 1, 
        autostopCount: 1 
    }); 

    var manualEffects = ['fade','turnUp','curtainY','blindZ','zoom']; 

    $container.children().each(function(i) { 
        $('<input type="button" value="'+(i+1)+'" />') 
            .appendTo($bc).click(function() { 
                // pass fx name as 2nd arg for a one-time override 
                $container.cycle(i, manualEffects[i]); 
                return false; 
            }); 
    }); 

}); 

http://jquery.malsup.com/cycle/goto4.html

In the below example how do i mention speed in 2nd case or atleast make it work instantaneously
$container.cycle(i, manualEffects[i]);

Also if i mention effect = none. it doesn't work

$(function() { 
    var $bc = $('#buttonContainer'); 

    var $container = $('#container').cycle({ 
        fx: 'scrollLeft', 
        speed: 300, 
        autostop: 1, 
        autostopCount: 1 
    }); 

    var manualEffects = ['fade','turnUp','curtainY','blindZ','zoom']; 

    $container.children().each(function(i) { 
        $('<input type="button" value="'+(i+1)+'" />') 
            .appendTo($bc).click(function() { 
                // pass fx name as 2nd arg for a one-time override 
                $container.cycle(i, manualEffects[i]); 
                return false; 
            }); 
    }); 

}); 

http://jquery.malsup.com/cycle/goto4.html

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

相对绾红妆 2025-01-05 05:13:58

查看此链接。我希望您正在查看 FastOnEvent 选项

http://jquery.malsup。 com/cycle/options.html

Check Out This link. I hope you are looking at FastOnEvent option

http://jquery.malsup.com/cycle/options.html

标点 2025-01-05 05:13:58

速度由代码中底部附近的 jquery.cycle.all.js (或缩小版本)控制:

在下面:

    // override these globally if you like (they are all optional)
    $.fn.cycle.defaults = {

您会看到一堆设置,包括:

    timeout:       6000,  // milliseconds between slide transitions (0 to   
    disable auto advance)

    speed:         1000,  // speed of the transition (any valid fx speed value)

这些是任意数字 - 自己调整它们。只需将超时更改为 6000(例如我的设置)即可获得更长的幻灯片。然后将过渡速度更改为 1000,例如,以获得更快的过渡。这很简单。

The speed is controlled by your jquery.cycle.all.js (or minified version) near the mid-bottom of the code:

Underneath:

    // override these globally if you like (they are all optional)
    $.fn.cycle.defaults = {

You'll see a bunch of settings, including:

    timeout:       6000,  // milliseconds between slide transitions (0 to   
    disable auto advance)

    speed:         1000,  // speed of the transition (any valid fx speed value)

Those are arbitrary numbers -- adjust them for yourself. Just change timeout to, for instance, 6000, like I have it, for a longer slide. Then change the transition speed to 1000, for instance, for a quicker transition. It's pretty simple.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文