Nadine
Nadine

Reputation: 787

unbind touchmove event in jquery

I invoke the following to prevent scrolling on a web app:

$('body').bind('touchmove', function(e){e.preventDefault()});

But on one page I need to cancel this. What would the opposite of this be? So when the page is called, I can call something like:

$('body').bind('touchmove', function(e){e.preventDefault() == TRUE}); or something

Upvotes: 0

Views: 6238

Answers (2)

gdoron
gdoron

Reputation: 150253

$('body').unbind('touchmove');

unbind docs:

Description: Remove a previously-attached event handler from the elements.

Upvotes: 3

Anthony Grist
Anthony Grist

Reputation: 38345

The opposite would be $('body').unbind('touchmove');.

Upvotes: 0

Related Questions