Alan
Alan

Reputation: 3058

jquery cycle: pause multiple slideshow

<script type="text/javascript">
$(window).load(function() {
    $('.thumbnail_container')
        .cycle('fade')
        .cycle('pause'); 
});
</script>

<div class="thumbnail_container">
    <img src='photos/10.jpg'>
    <img src='photos/11.jpg'>
</div>      
<div class="thumbnail_container">
    <img src='photos/20.jpg'>
    <img src='photos/21.jpg'>
</div>      
<div class="thumbnail_container">
    <img src='photos/30.jpg'>
    <img src='photos/31.jpg'>
</div>

I have written the above script. What I want is to pause all slideshows. However, all 3 slideshows had been faded but only the first one was paused.

How could I pause all 3 slideshows at the same time?

Upvotes: 1

Views: 679

Answers (1)

redsquare
redsquare

Reputation: 78667

You will have to do an each around all slideshows otherwise it will only activate the first match in the array.

 $('.thumbnail_container').each( function(){
   $(this).cycle('pause'); 
 });

Upvotes: 2

Related Questions