Skip to content
New issue

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

128.JS事件三个阶段 #128

Open
webVueBlog opened this issue Mar 28, 2020 · 1 comment
Open

128.JS事件三个阶段 #128

webVueBlog opened this issue Mar 28, 2020 · 1 comment
Labels
web综合 web综合

Comments

@webVueBlog
Copy link
Member

[js]

@webVueBlog webVueBlog added the web综合 web综合 label Mar 28, 2020
@webVueBlog
Copy link
Member Author

事件的处理过程主要有三个阶段:捕获阶段,目标阶段,冒泡阶段

  • 捕获,事件由页面元素接收,逐级向下,到具体的元素
  • 目标,具体的元素本身
  • 冒泡,元素本身,逐级向上,到页面元素
  1. 事件捕获,当使用事件捕获时,父级元素先触发,子元素后触发。
  2. 事件冒泡,当使用事件冒泡时,子级元素先触发,父元素后触发

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
web综合 web综合
Projects
None yet
Development

No branches or pull requests

1 participant