if ((body).hasClass('dialog-visible')){
document.body.addEventListener("touchmove", function(e) {
e.preventDefault();
}, false);
}
I am trying to remove preventDefault(); when the dialog is closed.
There is no 'opposite' of preventDefault(); However, you can choose nót to call it at any given time you want, by moving the if:
document.body.addEventListener("touchmove", function(e) {
if((body).hasClass('dialog-visible')){
e.preventDefault();
}
}, false);
Of course, another option is to use document.body.removeEventListener(function, false), but this means you will have to declare your function somewhere.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With