• jQuery 冒泡事件


    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>冒泡事件</title>
    <script src="scripts/jquery-1.7.1.min.js"></script>
    
    </head>
    <body>
    <script type="text/javascript"> 
    $(document).ready(function(){ 
    $('.one').click(function(e){ 
    alert('one'); 
    });             
    $('.two').click(function(e){   
    alert('two'); 
    e.stopPropagation(); 
    }); 
    $('.three').click(function(e){ 
    alert('three'); 
    //阻止起泡取消下面的注释 
    e.stopPropagation(); 
    }); 
    }); 
    </script> 
    <div class="one" style="200px;height:200px;background:green;"> 
    one 
    <a class="two" style="150px;height:150px;background:yellow;"> 
    two 
    <div class="three"> 
    three 
    </div> 
    </a> 
    </div> 
    </body>
    </html>
    

      

  • 相关阅读:
    androidactivity与webview结合
    anroid打包
    android之Fragment
    android布局
    anroid
    map reduce filter
    杂记
    spark记录
    Tomact和XML配置文件
    js-day02
  • 原文地址:https://www.cnblogs.com/arealy/p/7736744.html
Copyright © 2020-2023  润新知