I have this following javascript to activate sometime
document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
but I am having troubles removing the event listener when some i do this
document.removeEventListener('touchmove', function (e) { e.preventDefault(); }, false);
the function removeEventListener doesnt seem to work. I did a little search on similar cases and unfortunately i cant find the solution. I appreciate any help.
You are sending an anonymous function to the addEventListener call. Use a named function instead and send that to removeEventListener, like this:
Otherwise, the way you were doing it, the function you sent to removeEventListener was a completely different function, even though it had the same contents.