0

我试图让 3 个幻灯片在一个页面上运行,但速度/时间不同。我创建了一个可以在这里找到的小提琴...... http://jsfiddle.net/zq7XG/知道如何让它们表现不同吗?我真的需要在不同的时间改变这些。

提前致谢!

$(document).ready(function(){$('.slideshow').cycle({fx:'fade'});});




<div class="slideshow">
    <img src="http://cloud.github.com/downloads/malsup/cycle/beach1.jpg" width="200" height="200"/>
    <img src="http://cloud.github.com/downloads/malsup/cycle/beach2.jpg" width="200" height="200"/>
    <img src="http://cloud.github.com/downloads/malsup/cycle/beach3.jpg" width="200" height="200"/>
    <img src="http://cloud.github.com/downloads/malsup/cycle/beach4.jpg" width="200" height="200"/>
    <img src="http://cloud.github.com/downloads/malsup/cycle/beach5.jpg" width="200" height="200"/>
</div>

<div class="slideshow">
    <img src="http://cloud.github.com/downloads/malsup/cycle/beach1.jpg" width="200" height="200"/>
    <img src="http://cloud.github.com/downloads/malsup/cycle/beach2.jpg" width="200" height="200"/>
    <img src="http://cloud.github.com/downloads/malsup/cycle/beach3.jpg" width="200" height="200"/>
    <img src="http://cloud.github.com/downloads/malsup/cycle/beach4.jpg" width="200" height="200"/>
    <img src="http://cloud.github.com/downloads/malsup/cycle/beach5.jpg" width="200" height="200"/>
</div>

<div class="slideshow">
    <img src="http://cloud.github.com/downloads/malsup/cycle/beach1.jpg" width="200" height="200"/>
    <img src="http://cloud.github.com/downloads/malsup/cycle/beach2.jpg" width="200" height="200"/>
    <img src="http://cloud.github.com/downloads/malsup/cycle/beach3.jpg" width="200" height="200"/>
    <img src="http://cloud.github.com/downloads/malsup/cycle/beach4.jpg" width="200" height="200"/>
    <img src="http://cloud.github.com/downloads/malsup/cycle/beach5.jpg" width="200" height="200"/>
</div>
4

2 回答 2

1

为每个然后调用循环添加一个 ID。

<div class="slideshow" id="slideshow-1">...</div>
<div class="slideshow" id="slideshow-2">...</div>
<div class="slideshow" id="slideshow-3">...</div>

$(document).ready(function() {
    $('#slideshow-1').cycle({
        fx: 'fade',
        timeout: 5000,
    });

    $('#slideshow-2').cycle({
        fx: 'fade',
        timeout: 9000,
    });

    ...

});
于 2013-05-01T14:59:59.567 回答
1

我对你的代码做了些微改动。

请找到我尝试过的更改如下;

JS Fiddle Example

希望有帮助

于 2013-05-01T15:04:40.683 回答