Event Handler triggered for certain time + smooth animation
I'm trying to get smooth scrolling done on a huge horizontal slide. I've got Event Handler for
mousewheel working but the animation is choppy as h&%l. You can see the test
here. Test is inspired by
these guys.
The way it works now: delta (mousewheel scroll) is positive or negative. Now it adds or subtract a value on variable for maximum negative margin. Scrolling of DIV is done by immediately change of value for leftMargin.
What I want ;
- something like delta change smooth out with .animate() over certain time. Animate doesn't work smoothly right now because while scrolling animate is starting but event Handler is still triggered.
- acceleration with changing of value for leftPosition. (don't know what exactly would like good; time and/or delta)
- Some kind of decrease of acceleration when it reach it's 2 maximum positions.
Do you guys have any pointers? I'm a bit lost