loukmanebabakhalil / prototype-carousel

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

Second and subsequent scrolls don't work correctly. #35

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Scroll the carousel horizontally once.
2. Attempt to scroll horizontally again.
3. Notice that it doesn't move on the second try.

What is the expected output? What do you see instead?
I expect it to scroll twice. It only scrolls once.

What version of the product are you using? On what operating system?
I'm using carousel.js dated May 2009, in Firefox 3.6.11 on Mac OS X 10.6.5.

Please provide any additional information below.

SUGGESTED FIX:
In the function Carousel.moveTo, replace these two lines:
  x: (elementOffset[0] - scrollerOffset[0]),
  y: (elementOffset[1] - scrollerOffset[1]),

With these:
  x: (elementOffset[0] - scrollerOffset[0] + this.scroller.scrollLeft),
  y: (elementOffset[1] - scrollerOffset[1] + this.scroller.scrollTop),

I spent most of the afternoon diagnosing and fixing this. Hope the fix is 
useful to someone else.

Original issue reported on code.google.com by charles....@gmail.com on 29 Nov 2010 at 9:16