如何禁用此事件监听器以使其仅触发一次?
document.getElementById('element').ontouchmove = function (e)
{
DISABLE HERE
do something that should only happen once
};
最佳答案
document.getElementById('element').ontouchmove = function (e) {
this.ontouchmove = null;
// Do something here.
};
关于javascript在第一次点击后禁用事件监听器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13870230/