Cycle Plugin - How to use multiple slideshows on same page with hover control panel.
Hello - Im using the wonderful
cycle plugin for a one-page portfolio site. I have multiple divs, each showing a slideshow of project images. As an option, I'm using the 'hover controls' feature for each slideshow, but whenever I click
previous/
next, it advances all the slides on the page at the same time. How can I prevent this action and just click through one slideshow at a time? Thanks for any help.
Here is the JS:
- <script type="text/javascript">
- /* <![CDATA[ */
- $(function() {
- $('.slideshow').hover(
- function() { $('.controls').fadeIn(); },
- function() { $('.controls').fadeOut(); }
- );
-
- $('.slides').cycle({
- fx: 'scrollHorz',
- speed: 400,
- timeout: 0,
- next: '.next',
- prev: '.prev'
- });
- });
- /* ]]> */
- </script>
Here is the HTML:
- <div class="slideshow">
- <div class="controls">
- <span>← <a href="" class="prev">Prev</a></span>
- <span><a href="" class="next">Next</a> →</span>
- </div>
- <div class="slides">
- <a href="#"><img src="img/fpo_1.png" alt=""/></a>
- <a href="#"><img src="img/fpo_2.png" alt=""/></a>
- <a href="#"><img src="img/fpo_3.png" alt=""/></a>
- <a href="#"><img src="img/fpo_4.png" alt=""/></a>
- </div>
- </div>