Another question on iScroll 4. I have set up a demo in JSFiddle.
I want to scroll the div
on mousedown
. It should scroll to the end:
- continuously;
- without any interruption;
- with static speed;
Until it reaches the last div
, or I do a mouseup
in the middle.
Is it possible to achieve this?
Check this fiddle: http://jsfiddle.net/z2YWZ/2/
There is still one problem. It doesn't stop when it reaches the end. iScroll uses CSS
translate
to do the scrolling and I couldn't find a way to get the current translation form it. Currently looking for a solution for that.UPDATE
iScroll has a useTransform option, using which we can ask it not use translate and instead use CSS left property for scrolling. This way we'll be easily able to identify whether its the end has been reached (either way). To use, simply set
useTransform: false
while initing iScroll.UPDATE 2
Check this fiddle: http://jsfiddle.net/z2YWZ/12/