日期:2014-05-18 浏览次数:20498 次
<style> .tab { width:100px; padding-left:22px; height:17px; padding-top:5px; border-left:none; cursor:pointer; float:right; background-image:url(../images/tab.gif); background-repeat:no-repeat; } .tabsel { width:100px; padding-left:22px; height:17px; padding-top:5px; border-left:none; cursor:pointer; float:right; background-image:url(../images/tabsel.gif); background-repeat:no-repeat; } .closeimg { float:right; padding-right:10px; } .tabtext { text-align:center; float:left; padding-top:3px; padding-left:3px; padding-bottom:1px; } </style> </head> <body> <div class="title"> <br /> <div style="text-align: center;" id="divPanel"> <div class="tabsel" id="divTable" onclick="javascript:ShowTab(this);"> <div class="tabtext"> 默认页</div> <img class="closeimg" src="../images/tabclosesel.jpg" onclick="javascript:CloseTab(this)" /> </div> </div> </div> <div id="divFrames" style="width: 100%; border-top: solid 0px red"> <iframe id="iframeDefault" src="welcome.htm" width="100%" name="main"></iframe> </div> </body> </html> <script type="text/javascript"> SetIframeHeight(); function SetIframeHeight() { document.getElementById("iframeDefault").height = document.documentElement.clientHeight-82; document.getElementById("iframeDefault").contentWindow.onload = function() { //document.getElementById("divTable").innerHTML = document.getElementById("iframeDefault").contentWindow.document.title; } } window.onresize=function() { // SetIframeHeight(); } function Navigage(url,title) { //$("divTable").innerHTML = title; SetDivHtml($("divTable"),title); //$("iframeDefault").contentWindow.location = url; $("iframeDefault").src = url; ShowTab($("divTable")); // window.open(url,"main","",true); // alert( $("iframeDefault").contentWindow.location); } var aryTab = new Array(); aryTab[0] = $("divTable"); aryTab[0].iframe = $("iframeDefault"); var CurTab = aryTab[0]; var gOpenedUrl = new Object(); function NewTab(url,title) { if(gOpenedUrl[url] != null) { //alert("该页面已经打开!"); gOpenedUrl[url].click();//选中 return false; } var div = document.createElement("DIV"); div.className = "tabsel"; var divText = document.createElement("DIV"); divText.className = "tabtext"; div.appendChild(divText); var img = document.createEl