iframe子页面如何控制父页面里div隐藏
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/...
<!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>
<link rel="stylesheet" href="css/global.css" type="text/css"/>
<link rel="stylesheet" href="css/menu.css" type="text/css"/>
<script type="text/javascript" src="http://libs.useso.com/js/jquery/1.8.0/jquery-1.8.0.js"></script>
<script src="js/yzlpublic.js" language="javascript"></script>
</head>
<body>
<div id="b" class="category" style=" display:none; width:321px; height:550px; background-color:rgba(150,110,250,0.8); position:absolute; margin-top:30px;"></div>
<div id="show"><img src="images/menu.jpg" width="66" height="31" /></div>
<script>
$b = $("#b");
$("#show").on({
"click": function(){
$b.toggle();
return false;
}
});
$(document).on({
"click": function(e){
var src = e.target;
if(src.id && src.id ==="b"){
return false;
}else{
$b.hide();
}
}
});
</script>
<dl id="slide" >
<dt>我的桌面</dt>
<dd><iframe id=centerFrame name="centerFrame" class="centerFrame" frameborder="0" style="width: 100%;height:110px;; overflow-x: hidden; overflow-y:auto" noresize="noresize" scrolling="auto" src="子页面.html"></iframe>
</dd>
</dl>
</body>
</html> 展开
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link rel="stylesheet" href="css/global.css" type="text/css"/>
<link rel="stylesheet" href="css/menu.css" type="text/css"/>
<script type="text/javascript" src="http://libs.useso.com/js/jquery/1.8.0/jquery-1.8.0.js"></script>
<script src="js/yzlpublic.js" language="javascript"></script>
</head>
<body>
<div id="b" class="category" style=" display:none; width:321px; height:550px; background-color:rgba(150,110,250,0.8); position:absolute; margin-top:30px;"></div>
<div id="show"><img src="images/menu.jpg" width="66" height="31" /></div>
<script>
$b = $("#b");
$("#show").on({
"click": function(){
$b.toggle();
return false;
}
});
$(document).on({
"click": function(e){
var src = e.target;
if(src.id && src.id ==="b"){
return false;
}else{
$b.hide();
}
}
});
</script>
<dl id="slide" >
<dt>我的桌面</dt>
<dd><iframe id=centerFrame name="centerFrame" class="centerFrame" frameborder="0" style="width: 100%;height:110px;; overflow-x: hidden; overflow-y:auto" noresize="noresize" scrolling="auto" src="子页面.html"></iframe>
</dd>
</dl>
</body>
</html> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询