javascript 控制frameset左邊顯示與隱藏
阿新 • • 發佈:2018-12-23
<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>