JS與框架頁的操作代碼
更新時間:2010年01月17日 22:14:27 作者:
JS與框架頁的操作函數(shù)代碼,多用于控制框架頁,一般后臺利用的比較多。
1,刷新框架
onload=function()
{
try
{
parent.Link.location.reload();
}
catch(e)
{
}
}
2,獲取URL并字符處理
var url=parent.frames["right"].location.href;
//document.write('<Font size="2" color="red">'+url+"</Font>");
url=url.substring(url.indexOf("TBSW")+21,url.length);
3,設置Title
top.frames.left.document.title=url;
3,關閉頂則
<script type="text/javascript">
<!--
function ctrl()
{
var img=document.getElementById("imgctop");
var mainfrm=top.parent.window.frames["Frame"];
//alert (mainfrm);
if(mainfrm.rows == "55,*")
{
mainfrm.rows = "0,*";
img.src="Images/topopen.jpg";
img.alt="展開頂則";
}
else
{
mainfrm.rows = "55,*";
img.src="Images/topclose.jpg";
img.alt="關閉頂則";
}
}
//-->
</script>
4,左右則
<script type="text/javascript">
<!--
function ctrl()
{
var img=document.getElementById("imgctrl");
if(parent.document.all.bottom.cols == "170,7,*")
{
parent.document.all.bottom.cols = "0,7,*";
img.src="Images/open.jpg";
img.alt="展開左則";
}
else
{
parent.document.all.bottom.cols = "170,7,*";
img.src="Images/close.jpg";
img.alt="關閉左則";
}
}
//-->
</script>
復制代碼 代碼如下:
onload=function()
{
try
{
parent.Link.location.reload();
}
catch(e)
{
}
}
2,獲取URL并字符處理
復制代碼 代碼如下:
var url=parent.frames["right"].location.href;
//document.write('<Font size="2" color="red">'+url+"</Font>");
url=url.substring(url.indexOf("TBSW")+21,url.length);
3,設置Title
top.frames.left.document.title=url;
3,關閉頂則
復制代碼 代碼如下:
<script type="text/javascript">
<!--
function ctrl()
{
var img=document.getElementById("imgctop");
var mainfrm=top.parent.window.frames["Frame"];
//alert (mainfrm);
if(mainfrm.rows == "55,*")
{
mainfrm.rows = "0,*";
img.src="Images/topopen.jpg";
img.alt="展開頂則";
}
else
{
mainfrm.rows = "55,*";
img.src="Images/topclose.jpg";
img.alt="關閉頂則";
}
}
//-->
</script>
4,左右則
復制代碼 代碼如下:
<script type="text/javascript">
<!--
function ctrl()
{
var img=document.getElementById("imgctrl");
if(parent.document.all.bottom.cols == "170,7,*")
{
parent.document.all.bottom.cols = "0,7,*";
img.src="Images/open.jpg";
img.alt="展開左則";
}
else
{
parent.document.all.bottom.cols = "170,7,*";
img.src="Images/close.jpg";
img.alt="關閉左則";
}
}
//-->
</script>
相關文章
超越Jquery_01_isPlainObject分析與重構
isPlainObject是Jquery1.4后提供的新方法,用于判斷對象是否是純粹的對象(通過 {} 或者 new Object 創(chuàng)建的)。2010-10-10
JavaScript操作 url 中 search 部分方法函數(shù)
這篇文章主要介紹了JavaScript操作 url 中 search 部分方法函數(shù)的相關資料,非常不錯具有參考借鑒價值,需要的朋友可以參考下2016-06-06
使用weixin-java-miniapp配置進行單個小程序的配置詳解
這篇文章主要介紹了使用weixin-java-miniapp配置進行單個小程序的配置詳解,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2019-03-03
用javascript實現(xiàn)無刷新更新數(shù)據(jù)的詳細步驟 asp
用javascript實現(xiàn)無刷新更新數(shù)據(jù)的詳細步驟 asp...2006-12-12
javascript iframe內(nèi)的函數(shù)調(diào)用實現(xiàn)方法
用下面的方法可以調(diào)用iframe中的函數(shù),實現(xiàn)一些比較特殊的效果,不過能跨域的。2009-07-07
JavaScript中實現(xiàn)在光標位置插入內(nèi)容的幾種方法
本文主要介紹了在網(wǎng)頁開發(fā)中,如何使用JavaScript在文本輸入框或富文本編輯器的光標位置插入內(nèi)容的實踐,包括獲取光標位置的方法,創(chuàng)建文本節(jié)點,操作Selection對象,文中通過代碼介紹的非常詳細,需要的朋友可以參考下2024-10-10

