欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

javascript 窗口加載蒙板 內(nèi)嵌網(wǎng)頁內(nèi)容

 更新時(shí)間:2010年11月19日 20:11:07   作者:  
用于在現(xiàn)有窗口上加載蒙板,在蒙板內(nèi)在嵌入其他頁面內(nèi)容
復(fù)制代碼 代碼如下:

//初始化導(dǎo)航背景,iframe容器
function fnDaoHangBg()
{
var h = fnGetHeight(),w = fnGetWidth();//獲取背景窗口大小
if(!$('divDaoHangBg'))
{
var div = $C('div');//創(chuàng)建背景蒙板
div.id = 'divDaoHangBg';
div.style.backgroundColor = 'black';
div.style.position = 'absolute';
div.style.filter = 'alpha(opacity=80)';
div.style.opacity = '.80';
div.style.zIndex = 100001;
div.style.left = 0;
div.style.top = 0;
div.style.width = w+'px';
div.style.height= h+'px';
document.body.appendChild(div);
}

if(!$('divDaoHangBgIframe'))
{
var iframe;
iframe = this.$C('IFRAME');//創(chuàng)建蒙板內(nèi)的內(nèi)嵌iframe容器,用于嵌入顯示其他網(wǎng)頁
iframe.id = 'divDaoHangBgIframe';
iframe.frameBorder = '0';
iframe.scrolling = "no";
iframe.style.overflow = 'hidden';
iframe.allowTransparency = 'true';
iframe.style.display = 'none';
iframe.style.width = w+'px';//800
iframe.style.height = h+'px';//620
iframe.style.marginTop = '75px';//800
$('divDaoHangBg').appendChild(iframe);
}
if(!$('divDaoHangBgClose'))
{
var div = $C('div');//創(chuàng)建關(guān)閉按鈕在蒙板上
div.id = 'divDaoHangBgClose';
div.style.position = 'absolute';
div.style.backgroundImage='url(images/closb.gif)';
div.style.zIndex = 100003;
div.style.right = 10;
div.style.top = 20;
div.style.width = '82px';
div.style.height= '30px';
div.title='關(guān)閉';
div.style.cursor='hand';
div.onclick=function(){//點(diǎn)擊時(shí)間 ,關(guān)閉蒙板
fnDaoHangBgClose();
};
$('divDaoHangBg').appendChild(div);
}
$('divDaoHangBgIframe').style.display='block';
$('divDaoHangBg').style.display='block';
}
//關(guān)閉蒙板
function fnDaoHangBgClose()
{
if(!$('divDaoHangBg')){return;}
if(!$('divDaoHangBgIframe')){return;}
$('divDaoHangBgIframe').src='';
$('divDaoHangBgIframe').style.display='none';
$('divDaoHangBg').style.display='none';
}
//調(diào)用,內(nèi)嵌url
function fnDaoHangBgShow(url)
{
fnDaoHangBg();
$('divDaoHangBgIframe').src=url;
}

其中 $()和$C()分別表示
$(id),獲取該id的對象,document.getElementById(id)
$C(tag),創(chuàng)建一個標(biāo)簽, document.createElement(tag);

相關(guān)文章

最新評論