【发布时间】:2021-12-05 15:47:13
【问题描述】:
我有两个事件侦听器,它们都会根据视频状态在页面加载时触发。但如果两者都被解雇,我希望第一个停止运行。这怎么可能?
obj.addEventListener('suspend', () => {
// when only this is fired -> run this code
// my code
});
obj.addEventListener('play', () => {
// when this is fired too -> run this code and deactivate the first code
// my code
});
【问题讨论】:
标签: javascript function addeventlistener