We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
按照注册顺序执行
误区 1.在同一个对象上注册事件,并不一定按照注册顺序执行。 这一点,从上面的例子可以看出,你随便打乱四个事件绑定的顺序,结果一般不变!出现这样结果的原因是存在捕获模式和冒泡模式。但是值得注意的是,之所以如此是因为事件目的地节点既绑定了冒泡事件也绑定了捕获事件,此时的执行顺序按照绑定的先后顺序执行(情况比较少见)。 2.event.stopPropagation();就是阻止事件的冒泡。 这个表述不能说他错误,但是是不完整的,他除了阻止事件的冒泡,还阻止事件的继续捕获,简而言之就是阻止事件的进一步传播。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
JS事件执行顺序
事件的触发有三个阶段
按照注册顺序执行
事件捕获、事件冒泡
事件委托
The text was updated successfully, but these errors were encountered: