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 ');