malsup / cycle2

2nd gen cycling
899 stars 236 forks source link

Can I use Carousel and Slider on the same page? #514

Open demura opened 10 years ago

demura commented 10 years ago

If I have a cycle slide show like so:

div class="cycle-slideshow" data-cycle-fx="scrollHorz" data-cycle-pause-on-hover="true" data-cycle-speed="200"

img src="p1.jpg" img src="p2.jpg"

/div

Together with the Carousel on one page like so:

div class="slideshow" data-cycle-fx=carousel data-cycle-timeout=1000

img src="http://malsup.github.io/images/beach1.jpg"
img src="http://malsup.github.io/images/beach2.jpg"
...
img src="http://malsup.github.io/images/beach9.jpg"

/div

on one page, or the slideshow is not working or the carousel.

Please advise?

DannyJasper commented 10 years ago

This is not a support forum.

Marceloldel commented 9 years ago

For having more then one slidewhow you have to create a different id for each one, cycle2 finds every slideshow availeble by the name slideshow, so you have to create different id´s for telling cycle2 that each slideshow is different and associate for each one every option in cycle2. Not only that but i guess you have to programatically tell cycle2 how to treat each slide differently. so.. it´s best you get to http://jquery.malsup.com/cycle2/ and see how to do it so. I know there is a code for pager carosel tho. Not sure if it´s needed nor if it´s avaible a code to do the trick.