網(wǎng)頁中可關(guān)閉的漂浮窗口實現(xiàn)可自行調(diào)節(jié)
更新時間:2013年08月20日 15:19:36 作者:
廣告式的漂浮窗口,想必大家并不陌生吧,下面為大家簡單介紹下具體的實現(xiàn),有需要的朋友可以參考下
注釋部分為廣告的左右調(diào)節(jié),可以自行設(shè)定
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>網(wǎng)頁中可關(guān)閉的漂浮窗口</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
</head>
<body style="background-color:#09C">
<div id="ShowAD" style="position:absolute;z-index:100;">
<div style="width:135;height:18px;font-size:14px;font-weight:bold;text-align:left;cursor:hand;" onClick="closead();"><font color="ff0000">關(guān)閉</font><br/>
點擊這里,關(guān)閉廣告!??!<br><a href="/jscss/"><img src="img/ads1.png"></a>
</div>
<script type="text/javascript">
var bodyfrm = ( document.compatMode.toLowerCase()=="css1compat" ) ? document.documentElement : document.body;
var adst = document.getElementById("ShowAD").style;
adst.top = ( bodyfrm.clientHeight -530-22 ) + "px";
//adst.left = ( bodyfrm.clientWidth -155) + "px";
function moveR()
{
adst.top = ( bodyfrm.scrollTop + bodyfrm.clientHeight - 530-22) + "px";
//adst.left = ( bodyfrm.scrollLeft + bodyfrm.clientWidth - 155 ) + "px";
}
setInterval("moveR();", 80);
function closead()
{
adst.display='none';
}
</script>
<div id="Content" style="height:1200px;"></div>
</body>
</html>
復(fù)制代碼 代碼如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>網(wǎng)頁中可關(guān)閉的漂浮窗口</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
</head>
<body style="background-color:#09C">
<div id="ShowAD" style="position:absolute;z-index:100;">
<div style="width:135;height:18px;font-size:14px;font-weight:bold;text-align:left;cursor:hand;" onClick="closead();"><font color="ff0000">關(guān)閉</font><br/>
點擊這里,關(guān)閉廣告!??!<br><a href="/jscss/"><img src="img/ads1.png"></a>
</div>
<script type="text/javascript">
var bodyfrm = ( document.compatMode.toLowerCase()=="css1compat" ) ? document.documentElement : document.body;
var adst = document.getElementById("ShowAD").style;
adst.top = ( bodyfrm.clientHeight -530-22 ) + "px";
//adst.left = ( bodyfrm.clientWidth -155) + "px";
function moveR()
{
adst.top = ( bodyfrm.scrollTop + bodyfrm.clientHeight - 530-22) + "px";
//adst.left = ( bodyfrm.scrollLeft + bodyfrm.clientWidth - 155 ) + "px";
}
setInterval("moveR();", 80);
function closead()
{
adst.display='none';
}
</script>
<div id="Content" style="height:1200px;"></div>
</body>
</html>
相關(guān)文章
解析img圖片沒找到onerror事件 Stack overflow at line: 0
本篇文章主要介紹了img圖片沒找到onerror事件 Stack overflow at line: 0 需要的朋友可以過來參考下,希望對大家有所幫助2013-12-12knockoutjs模板實現(xiàn)樹形結(jié)構(gòu)列表
這篇文章主要介紹了knockoutjs模板實現(xiàn)樹形結(jié)構(gòu)列表的實現(xiàn)代碼,非常不錯,具有參考借鑒價值,需要的朋友參考下吧2017-07-07JS實現(xiàn)HTML標簽轉(zhuǎn)義及反轉(zhuǎn)義
本文主要介紹了JS實現(xiàn)HTML標簽轉(zhuǎn)義及反轉(zhuǎn)義的方法。具有一定的參考價值,下面跟著小編一起來看下吧2017-01-01屏蔽網(wǎng)頁右鍵復(fù)制和ctrl+c復(fù)制的js代碼
解決的方法就是直接把網(wǎng)頁保存下來然后刪掉下面這段js代碼,然后就可以正常用右鍵菜單,也可以通過設(shè)置瀏覽器的安全級別到最高級別來解決問題2013-01-01如何通過vscode運行調(diào)試javascript代碼
這篇文章主要介紹了如何通過vscode運行調(diào)試javascript代碼,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下2020-07-07