Smooth Overflow Scrolling in touch screen devices
Posted By : Prince Kumar | 27-Sep-2017
Hi As we know that default scrolling in our Web Application's mobile view
As we scroll the page, the page scrolls normally but with a jerk not with that smoothness that comes in our default mobile applications.
What can we do to resolve this issue?
I also faced the same issue and finally, I found some solution for this.
In this case, we will use CSS's -WebKit-overflow-scrolling property. Let's take an example, suppose we have a div with a class name touch.
HTML
Lorem Ipsum is simply dummied text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
CSS
.touch {
width: 300px;
height: 200px;
overflow-y: scroll; /* has to be scroll, not auto */
-webkit-overflow-scrolling: touch;
}
What will this Do? This will make a scrollable section smooth. So that when we scroll we don't feel jerks.
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Prince Kumar
Prince is a sharp and intellectual UI Developer, he has a good knowledge of HTML. CSS, Jquery. His hobbies are reading books, listening music and net surfing,