Veilkrand
asked on
How to enable a ontouchmove event after calling a preventdefault()
I have an Iphone webapp with several views. To stop scroll bouncing I use a preventdefault() for the ontouchmove event on load.
But I have a view with long text where I need to activate scrolling. But only for that view.
Thanks
But I have a view with long text where I need to activate scrolling. But only for that view.
Thanks
document.body.ontouchmove = function(e){
e.preventDefault();
}
ASKER
Sorry I think you didn't understand the question.
I need to set original default event before preventdefault call.
I need to set original default event before preventdefault call.
ASKER
Would be possible to implement something like this to restore previous default behaviour of the event?
var defaultEvent;
document.body.ontouchmove = function(e){
defaultEvent=e;
}
document.body.ontouchmove = function(e){
e.preventDefault();
}
document.body.ontouchmove = defaultEvent;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
document.body.ontouchmove = null;
or if a 'view' is a particular element and not a page
yourview.ontouchmove = null;
Just my 2 cents.