zoukankan      html  css  js  c++  java
  • Event Flow

    事件的流动通常会经历这么三个阶段:

    捕获阶段(capture phase)

    The event object propagate through the target's ancestors from the defaultView to the target's parent.
    事件对象在事件目标的祖先中上到下顺向传播,从最顶层的defaultView到事件目标的(直系)父元素。

    捕获阶段发生在整个事件流动的开始。在这阶段里事件会从父(主干)到子(分支)由上往下传播,被元素一层层地捕获。

    目标阶段(target phase)

    The event object arrive at the event object's event target.
    事件对象到达事件目标。

    如果事件是不可冒泡的,那整个事件流动会到此为止,不会发生下面的冒泡阶段。

    冒泡阶段(bubble phase)

    The event object propagates through the target's ancestors in reverse order, starting with the target's parent and ending with the defaultView.
    事件对象会在事件目标的祖先元素里反向传播,由开始的父元素到最后的defaultView(document)。

    冒泡阶段发生在最后,这也是我们最为熟悉的一个阶段。在这阶段里事件会从子(分支)到父(主干)逆向传播,看起来像是一个水里的泡泡往上冒。

  • 相关阅读:
    JavaScript的DOM操作(节点操作)
    php算法
    php常用函数
    去掉表单中的回车、换行、空格
    linux(centos)搭建SVN服务器
    同一台机子上用多个git 账号
    房屋交易合同
    简单的css 菜单
    Spring Collections XML 配置
    不同java 版本的新功能
  • 原文地址:https://www.cnblogs.com/ren120165809/p/9981316.html
Copyright © 2011-2022 走看看