jquery循环函数参数
在下面的示例中,我如何提及第二种情况下的速度或至少使其立即工作 $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;
});
});
});
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;
});
});
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看此链接。我希望您正在查看
FastOnEvent
选项http://jquery.malsup。 com/cycle/options.html
Check Out This link. I hope you are looking at
FastOnEvent
optionhttp://jquery.malsup.com/cycle/options.html
速度由代码中底部附近的 jquery.cycle.all.js (或缩小版本)控制:
在下面:
您会看到一堆设置,包括:
这些是任意数字 - 自己调整它们。只需将超时更改为 6000(例如我的设置)即可获得更长的幻灯片。然后将过渡速度更改为 1000,例如,以获得更快的过渡。这很简单。
The speed is controlled by your jquery.cycle.all.js (or minified version) near the mid-bottom of the code:
Underneath:
You'll see a bunch of settings, including:
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.