<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>jQuery case-2</title>
<style type="text/css">
#d1{
width:300px;
height:300px;
background-color:red;
margin:10px auto;
position:relative;
}
#d2{
width:200px;
height:200px;
background-color:blue;
position:absolute;
top:50px;
left:50px;
}
/*父元素已经定位了,则以父元素为参照物 */
#d3{
width:100px;
height:100px;
background-color:yellow;
position:absolute;
top:50px;
left:50px;
}
</style>
<script type="text/javascript" src="../js/jquery-1.11.1.js"></script>
<script type="text/javascript">
/*
点击父、子元素时弹出提示信息
点击子元素时取消事件冒泡
*/
$(function(){
$(
jQuery阻止事件冒泡
最新推荐文章于 2024-08-10 02:17:33 发布