This will help you place the .scroll class on the element you still want to scroll.
What happens, all touches move by default. If the element you want to scroll has the .scroll class on it, it sets the gate to true to allow it to pass.
At the end of the contact, you reset the shutter to false.
This works on iOS5 and 6 and can work on Chrome and Safari.
Check out @ this post to expand it
How to prevent page scrolling while scrolling a div element?
The only catch is that if you scroll the scrollable element, the elastic effect allows you to scroll the scroll on the tree, and the scroll - true. Manually adjusting the scroll position is canceled due to the terrible bounce effect.
I bet these Apple frigates have a built-in scrolling implementation that runs on a set timeout with every complex wired step.
So, if you scroll to -20, I think these are hard wires, every step in the loop, not checking where it was. Scrolling to -20 -19 -18, etc. in sequence.
We must think about it! (in fact, having typed this load, I have an idea!)
$(function(){ var scroll = false var scroll_element; $('body').on('touchmove',function(e){ if(!scroll){ e.preventDefault() } }) $('body').on('touchend',function(e){ scroll = false }) $('.scroll').on('touchstart',function(e){ scroll_element = this scroll = true }) })
source share