If the html document is disabled. (no scrolling…)
document.ontouchmove = function(event){ event.preventDefault(); }
Can I selectively enabled elements in the html document? such as a div, span
What javascript should I use to do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here’s a fairly hacky solution.
Change your
touchmovehandler as follows:Then for an element that you want to enable:
This works because:
touchmoveevent is fired on the element, both of these event handlers handle the event in the bubbling phase. This means that the elementtouchmovehandler fires first, because it is closest to the source of the event.So, the element
touchmovehandler just sets a custom property on the event object, and then the documenttouchmovehandler checks for that custom property to determine whether the default action should be prevented.