87,910
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script src="jquery-1.9.0.js"></script>
<script>
$(function(){
$("body").click(function(e){
$("#div").hide();
});
$("#btn").click(function(e){
$("#div").show();
e.stopPropagation(); //这是阻止事件冒泡和用return false一个效果
});
$("#div").click(function(e){
e.stopPropagation(); //这是阻止事件冒泡和用return false一个效果
});
})
</script>
</head>
<body style="width:2000px; height:2000px;">
<input type="button" value="显示" id="btn" />
<div id="div" style="width:500px; height:300px; border:#F00 1px solid; display:none;"></div>
</body>
</html>
$('body').click(function () {
$('.Intro').hide();
})
我这样写了以后,那个层就没办法显示了