http://jsfiddle.net/NCt4D/8/
Is what I currently got. The loaded image is big:
After it has scrolled to the last iphone screenshot, it stops. I would like it to continue, so it shows from the beginning again.
How would i do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For starters, you’re comparing scrollLeft with offsetHeight and scrollHeight. Change those to Width.
Next, you’re returning the scroll position to 0 if the current scroll position is less than the maximum. So on the first step the position is 1, which is clearly less than the max, so it jumps back to zero. Result: You’re not going anywhere. Try greater than instead.
There are a few other things wrong with the code, but they’re just optimisations. The two points above are what is majorly wrong with your code.