您的位置:首页 > Web前端 > JavaScript

javascript 控制frameset左边显示与隐藏

2014-10-08 16:25 232 查看
<frameset cols="180,16,*" id=pageframe>
<frame noresize name="menu" scrolling="yes" src="${pageContext.request.contextPath}/home_left.action">
<frame noresize name="frameline" scrolling="yes" src="${pageContext.request.contextPath}/home_frameline.action">
<frame noresize name="right" scrolling="yes" src="${pageContext.request.contextPath}/home_right.action">
</frameset>


<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true" %>
<html>
<head>
<title>frameline</title>
<%@ include file="/WEB-INF/jsp/public/commons.jspf"%>
<style type="text/css">
body{
background-color: #BFDDF1;
}
.panel-tool {
position: absolute;
top: 50%;
margin-top: -8px;
height: 16px;
overflow: hidden;
}
.panel-tool a {
display: inline-block;
width: 12px;
height: 16px;
opacity: 0.6;
filter: alpha(opacity=60);
margin: 0 0 0 2px;
vertical-align: top;
}
.layout-button-left {
background: url('style/images2/layout_arrows.png') no-repeat 0 0;
}
</style>
<script type="text/javascript">
function ShowHideLeft(objtd){
if (parent.pageframe.cols=="180,16,*"){
parent.pageframe.cols="0,16,*";
document.getElementById("frameLine").style.background=" url('style/images2/layout_arrows.png') no-repeat 0 -16px";
}
else{
parent.pageframe.cols="180,16,*";
document.getElementById("frameLine").style.background=" url('style/images2/layout_arrows.png') no-repeat 0 0px";
}
}
</script>
</head>
<body>
<div class="panel-tool">
<a id="frameLine" href="javascript:void(0)" onClick="ShowHideLeft(this);"
class="layout-button-left "></a>
</div>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: