javascript: iframe switchSysBar 左欄打開關閉,兼容各瀏覽器操作

<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>javascript iframe  switchSysBar 左欄打開關閉,兼容各瀏覽器操作</title>

		<!--
		iframe  左欄打開關閉,兼容各瀏覽器操作
		參考:http://anole-erp.googlecode.com/svn-history/r1914/trunk/Anole-server/WebContent/global/js/jquery/
				http://anole-erp.googlecode.com/svn/trunk/
				
		<script type="text/javascript" src="js/anole.js"></script>
		<script type="text/javascript" src="js/loadImage.js"></script>
		<script type="text/javascript" src="js/jquery/lib/jquery.js"></script>
		<script type="text/javascript" src="js/jquery/jquery.bgiframe.min.js"></script>
		<script type="text/javascript" src="js/jquery/jquery-ui-1.8.1.custom.min.js"></script>
		<script type="text/javascript" src="js/jquery/jquery.alerts.js"></script>-->
<style type="text/css">
		body {
			overflow-x:hidden; 
			overflow-y:hidden; 
			} 
	</style>

	<script language="javascript" type="text/javascript">
	//塗聚文修改 20130716
		var screenW = 640, screenH = 480;
		if (parseInt(navigator.appVersion)>3) {
		 screenW = screen.width;
		 screenH = screen.height;
		}
		else if (navigator.appName == "Netscape" 
		    && parseInt(navigator.appVersion)==3
		    && navigator.javaEnabled()
		   ) 
		{
		 var jToolkit = java.awt.Toolkit.getDefaultToolkit();
		 var jScreenSize = jToolkit.getScreenSize();
		 screenW = jScreenSize.width;
		 screenH = jScreenSize.height;
		}
		
		function switchSysBar(){

			if(document.getElementById("frmMenu").style.display == "none"){
				var iswitch = "images/arrow01.png";
				var switchhtml = "<img border=\"0\" Title=\"關閉\" alt=\"關閉\" style=\"cursor:hand;\" src=\"" + iswitch + "\"/>";
				
				switchPoint.innerHTML = switchhtml;
				document.getElementById("frmMenu").style.display = "";
			}
			else{
				var iswitch = "images/arrow02.png";
				var switchhtml = "<img border=\"0\" Title=\"打開\" alt=\"關閉\" style=\"cursor:hand;\" src=\"" + iswitch + "\"/>";
				
				switchPoint.innerHTML = switchhtml;
				document.getElementById("frmMenu").style.display = "none";
			}
		}
	</script>

</head>

<body>
<div>
<table id="maintable" height="100%" width="100%" cellSpacing=0 cellPadding=0 align='left' border='0'>
	    	<tr>
	    		<td width="100%" height="80" colspan="3" valign="top">
	    			javascript iframe  switchSysBar 左欄打開關閉,兼容各瀏覽器操作
	    		</td>
	    	</tr>
	       	<tr>
	         	<td id="frmMenu" style="background-color:#faecd1;width:200px;" height="590" valign="top" noWrap>
		         	<iframe name="navigate" src="menu.html" width="100%" height="98%" frameborder="0" scrolling="yes" marginwidth="0"></iframe>
	         	</td>
	         	<td id="switchbar" style="background-color:#faecd1;width:5px; border-right:#FF0000 dotted 1px;" valign="middle">
		         	<a onclick="javascript:switchSysBar();" id="switchPoint">
		         		<img id="switchPoint" style="cursor:hand;" src="images/arrow01.png" alt="關閉" title="關閉"/>
		         	</a>
				</td>
	         	<td width="100%" valign="top">	         	  
	         		<iframe name="body" src="2.html" width="100%" height="99%" frameborder="0" scrolling="yes" marginwidth="0"></iframe>
				</td>
	       	</tr>
		</table>
		</div>
</body>

</html>

你可能感兴趣的:(JavaScript)