I'm in the process of implementing the jQuery cycle plugin to create 20 image galleries each with their own previous, next, and pager navigation controls without having to create and reference 3 new id names per slideshow and avoid having to create a separate function for each slideshow. In the example below I attempted to give each slideshow a unique pager but without limited success. I'm hoping that there is a more intuitive way to write this using the .each() function. Thanks in advance to anyone that can help.
HTML: (I've only included two slideshows in this example)
<div class="slideshow_container">
<div class="work_slideshow">
<div class="slideshow" id="s1">
<img class="slide" src="images/port/design_unique_1.jpg" />
<img class="slide" src="images/port/design_unique_2.jpg" />
<img class="slide" src="images/port/design_unique_3.jpg" />
</div>
<div class="controls">
<img src="images/arrow_left.png" class="prev"/>
<img src="images/arrow_right.png" class="next"/>
</div>
<div class="pager" id="pager1"></div>
</div>
<div class="work_slideshow">
<div class="slideshow" id="s2">
<img class="slide" src="images/port/design_equality_1.jpg" />
<img class="slide" src="images/port/design_equality_2.jpg" />
</div>
<div class="controls">
<img src="images/arrow_left.png" class="prev"/>
<img src="images/arrow_right.png" class="next"/>
</div>
<div class="pager" id="pager2"></div>
</div>
</div>
jQuery:
$('.slideshow').cycle({
fx: 'fade',
easing: 'easeOutExpo',
speed:2000,
prev:'.prev',
next:'.next',
timeout:0,
pagerAnchorBuilder: function(idx, el) {
return '<a href="#" title="Slides"></a>';
},
});
$('#s1').cycle({
pager:'#pager1'
});
$('#s2').cycle({
pager:'#pager2'
});