js事件注销

2019-01-02 20:35发布

注册一个事件的写法
banner.addEventListener('touchmove', function(e));
像这种匿名事件貌似无法移除,而我想在以后移除该事件,所以:
banner.addEventListener('touchmove', moveEvent(e,startX, index, banner.offsetWidth));
但是e(touchEvent)和一系列的参数无法像这样传递,请问这种情况如何移除事件?

标签:
2条回答
十年一品温如言
2楼-- · 2019-01-02 20:56

banner.addEventListener('touchmove', moveEvent)
functon moveEvent(e) {
e.startX
}

查看更多
登录 后发表回答