JS與框架頁的操作代碼
更新時(shí)間:2010年01月17日 22:14:27 作者:
JS與框架頁的操作函數(shù)代碼,多用于控制框架頁,一般后臺(tái)利用的比較多。
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,設(shè)置Title
top.frames.left.document.title=url;
3,關(guān)閉頂則
<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="關(guān)閉頂則";
}
}
//-->
</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="關(guān)閉左則";
}
}
//-->
</script>
復(fù)制代碼 代碼如下:
onload=function()
{
try
{
parent.Link.location.reload();
}
catch(e)
{
}
}
2,獲取URL并字符處理
復(fù)制代碼 代碼如下:
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,設(shè)置Title
top.frames.left.document.title=url;
3,關(guān)閉頂則
復(fù)制代碼 代碼如下:
<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="關(guān)閉頂則";
}
}
//-->
</script>
4,左右則
復(fù)制代碼 代碼如下:
<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="關(guān)閉左則";
}
}
//-->
</script>
相關(guān)文章
超越Jquery_01_isPlainObject分析與重構(gòu)
isPlainObject是Jquery1.4后提供的新方法,用于判斷對(duì)象是否是純粹的對(duì)象(通過 {} 或者 new Object 創(chuàng)建的)。2010-10-10
JavaScript操作 url 中 search 部分方法函數(shù)
這篇文章主要介紹了JavaScript操作 url 中 search 部分方法函數(shù)的相關(guān)資料,非常不錯(cuò)具有參考借鑒價(jià)值,需要的朋友可以參考下2016-06-06
使用weixin-java-miniapp配置進(jìn)行單個(gè)小程序的配置詳解
這篇文章主要介紹了使用weixin-java-miniapp配置進(jìn)行單個(gè)小程序的配置詳解,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2019-03-03
用javascript實(shí)現(xiàn)無刷新更新數(shù)據(jù)的詳細(xì)步驟 asp
用javascript實(shí)現(xiàn)無刷新更新數(shù)據(jù)的詳細(xì)步驟 asp...2006-12-12
javascript iframe內(nèi)的函數(shù)調(diào)用實(shí)現(xiàn)方法
用下面的方法可以調(diào)用iframe中的函數(shù),實(shí)現(xiàn)一些比較特殊的效果,不過能跨域的。2009-07-07
JavaScript中實(shí)現(xiàn)在光標(biāo)位置插入內(nèi)容的幾種方法
本文主要介紹了在網(wǎng)頁開發(fā)中,如何使用JavaScript在文本輸入框或富文本編輯器的光標(biāo)位置插入內(nèi)容的實(shí)踐,包括獲取光標(biāo)位置的方法,創(chuàng)建文本節(jié)點(diǎn),操作Selection對(duì)象,文中通過代碼介紹的非常詳細(xì),需要的朋友可以參考下2024-10-10
JS過濾url參數(shù)特殊字符的實(shí)現(xiàn)方法
本篇文章主要是對(duì)JS過濾url參數(shù)特殊字符的實(shí)現(xiàn)方法進(jìn)行了詳細(xì)的分析介紹,需要的朋友可以過來參考下,希望對(duì)大家有所幫助2013-12-12

