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 in not smooth enough whether it's Android or iOS.

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.

 

About Author

Author Image
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,

Request for Proposal

Name is required

Comment is required

Sending message..