Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

using iScroll 4 scroll the last element to the start position of first element

using iScroll 4 scroll the last element to the start position of first element

Problem

I am now using iScroll 4 from http://cubiq.org/iscroll-4 to enable scrolling in touch devices.The problem is that the last Element is not coming proper. I want the last element to scroll till the start position of the scroll. I am not understanding how to make it work. The last element is not coming to the center of the screen width. I have positioned the first element to the center of screen. Thanks in advance for any help.

Problem courtesy of: user850234

Solution

We just need to do (Screen width - Element width) + (Number of elements*Element width) to bring the last element to the start position of the scroll. Here in my case center of the screen.

Solution courtesy of: user850234

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

using iScroll 4 scroll the last element to the start position of first element

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×