📜  jQuery | event.isPropagationStopped() 方法

📅  最后修改于: 2021-11-25 03:26:08             🧑  作者: Mango

jQuery 中的event.isPropagationStopped() 方法用于检查对象 event.stopPropagation() 是否被调用。如果 event.stopPropagation() 被调用,则返回 true,否则返回 false。

句法:

event.isPropagationStopped()

参数:它包含强制性的单个参数事件。该参数来自事件绑定函数。

示例 1:本示例使用 event.isPropagationStopped() 方法来检查 event.stopPropagation() 是否被调用。



      

    
      
    

  

    

        jQuery event.isPropagationStopped() Method     

           

        click on button to check if the          event.stopPropagation() is called.     

              

输出:

  • 点击按钮前:
  • 点击按钮后:

示例 2:本示例使用 event.isPropagationStopped() 方法来检查 event.stopPropagation() 是否被调用。



      

    
        event.isPropagationStopped method
    
      
    

  

    

        jQuery event.isPropagationStopped() Method     

           

          click on button to check if the          event.stopPropagation() is called.     

                       
                        

输出:

  • 点击按钮前:
  • 点击按钮后: