loukmanebabakhalil / prototype-carousel

Automatically exported from code.google.com/p/prototype-carousel
0 stars 0 forks source link

Carousel with multiple visibleSlides, next() doesnt work #45

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Making carousel with couple items shown ex.
CR = new Carousel('carousel-wrapper', $$('#carousel-content .slide'), 
$$('a.carousel-control', 'a.carousel-jumper'), {auto: false, frequency: 3, 
duration: 0.5, wheel: true, circular: true, visibleSlides:2});

2. Now make CR.next() (use buttons, scroll, or even JS) till end.
3. "circural:true" is set, so it should get back to beggining. 

What is the expected output? What do you see instead?

CR.prev() works fine - it backs to end. I think next() should work similar.

When u have visibleSlides set to 1 it works fine.

Original issue reported on code.google.com by Andrew8...@gmail.com on 13 Sep 2013 at 2:26

GoogleCodeExporter commented 8 years ago
I repaired it:

Find line 195, and put there instead:

"var nextIndex = (this.slides.length - this.options.visibleSlides == 
currentIndex) ? (this.options.circular ? 0 : currentIndex) : currentIndex + 1;"

Original comment by Andrew8...@gmail.com on 13 Sep 2013 at 2:54