您可以定义一个自定义过渡,淡出当前幻灯片,等待,然后淡入下一张幻灯片。
有关比下面更完整的示例,请参阅:http: //jsfiddle.net/QGRv9/1/
$.fn.cycle.transitions.fadeOutWaitFadeIn = function($cont, $slides, opts) {
opts.fxFn = function(curr, next, opts, after) {
$(curr).fadeOut(opts.fadeSpeed, function() {
$(next).delay(opts.delayBetweenFades).fadeIn(opts.fadeSpeed, function() {
after();
});
});
};
};
$(function() {
$('#slideshow').cycle({
fx: 'fadeOutWaitFadeIn',
fadeSpeed: 500,
delayBetweenFades: 2000,
//The timeout value includes the fade speed (twice) and delay between fades.
//e.g. For a 3000 ms timeout, use 3000 + 500 * 2 + 2000 = 6000.
timeout: 6000
});
});
请注意,我可能在这里做错了什么。超时不应该包括其他值。还有一个小问题:第一张幻灯片显示 6000 毫秒而不是 3000 毫秒。