IOS auto-rolling and IOS auto-Rolling

Source: Internet
Author: User

IOS auto-rolling and IOS auto-Rolling

The so-called elastic scroll refers to the process from slow to slow when the finger of a long page is turned.

 

Most browsers on the Android platform default this behavior.

Currently, ios only produces auto-scroll effects for the overflow under <body> by default.

 

A while ago I made a mobile phone official website, used the overflow in <div>, and then debugged the problem of elastic scrolling in ios:

Webkit auto-rolling css command in ios-webkit-overflow-scrolling: touch;

This command is used to switch the div that also requires scrolling.

1. Scroll along with the previous scroll

2. Start positioning Deviation

3. Stuck attention (losing focus)

 

Solution:

. Session {

-Webkit-overflow-scrolling: touch;

}

1. Remove the overflow-scrolling attribute of the element while switching the label.

$ ('. Session'). removeClass ('sollow ');

2. Switch the tag and initialize the target div.

Document. getElementById ('target '). ScrollTop= '0px '; // Add as needed

3. Reload sollow to the target element.

$ ('. Session: eq (' + tar + '). addClass ('display sollow ');

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.