关注前端开发微信微信号web007007

带关闭功能的网站顶部滑出的广告提示条

作者 管理员 发布时间 2012-06-02 17:15 文章分类 JavaScript 文章评论 抢沙发 阅读次数

<!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>带关闭功能的网站顶部滑出的广告提示条</title>
<style>
body{margin:0px;padding:0px}
.home_tx {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: url(http://www.codefans.net/jscss/demoimg/201011/hometx_03.gif); PADDING-BOTTOM: 0px; MARGIN: auto; OVERFLOW: hidden; WIDTH: 950px; PADDING-TOP: 0px}
.home_tx IMG {BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; BORDER-RIGHT-WIDTH: 0px}
.home_tx DL {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FLOAT: left; PADDING-BOTTOM: 0px; MARGIN: 0px 10px 0px 0px; WIDTH: 61px; PADDING-TOP: 0px; HEIGHT: 37px}
.home_tx SPAN {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 12px; FLOAT: left; PADDING-BOTTOM: 0px; MARGIN: 0px; WIDTH: 830px; COLOR: #333333; LINE-HEIGHT: 34px; PADDING-TOP: 0px; HEIGHT: 37px; TEXT-ALIGN: left}
.home_tx SPAN B {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: normal; FLOAT: left; PADDING-BOTTOM: 0px; MARGIN: 0px; COLOR: #990000; PADDING-TOP: 0px}
.home_tx A {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FLOAT: right; PADDING-BOTTOM: 0px; MARGIN: 0px; WIDTH: 35px; PADDING-TOP: 0px; HEIGHT: 37px}
</style>
</head>
<body>
<DIV id=home_tx style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: auto; OVERFLOW: hidden; WIDTH: 950px; PADDING-TOP: 0px; POSITION: relative; HEIGHT: 1px">
<DIV class=home_tx id=home_tx_in style="POSITION: absolute; TOP: -37px; HEIGHT: 37px" align=center>
<DL><IMG src="http://myjs.jz123.cn/img/hometx_01.gif"></DL><SPAN><B>团购网站大全-优团网免费收录优秀的诚信的团购网站,欢迎加入。</B>
<A style="FLOAT: none" href="http://www.0491.com" target=_blank>详情>></A></SPAN> <A style="CURSOR: pointer" onfocus=this.blur() onClick="home_tx_hide();return false;" href="#"><IMG src="http://myjs.jz123.cn/img/hometx_04.gif"></A> </DIV></DIV>
<script>
var is_home_tx_show = false;
var div_home_tx = document.getElementById("home_tx");
var div_home_tx_in = document.getElementById("home_tx_in");
var stepms = 10;
function home_tx_show(){
home_tx_stepshow();
}
function home_tx_stepshow(){
var curHeight = parseInt(div_home_tx.offsetHeight);
if(curHeight>=37){
is_home_tx_show = true;
}else{
div_home_tx.style.height = (curHeight + 4) + "px";
div_home_tx_in.style.top = (parseInt(div_home_tx_in.style.top)+4)+"px";
window.setTimeout(home_tx_stepshow,30);
}
}
function home_tx_hide(){
if(is_home_tx_show){
home_tx_stephide()
}else{
window.setTimeout(home_tx_stephide,1200);
}
}
function home_tx_stephide(){
var curHeight = parseInt(div_home_tx.style.height);
if(curHeight<=0){
is_home_tx_show = false;
}else{
try{
div_home_tx.style.height = (curHeight - 4) + "px";
div_home_tx_in.style.top = (parseInt(div_home_tx_in.style.top)-4)+"px";
window.setTimeout(home_tx_stephide,30);
} catch(e) {}
}
}
if(window.addEventListener){
window.addEventListener("load",home_tx_show,false);
}else{
window.attachEvent("onload",home_tx_show);
}
</script>
</body>
</html>

<!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>带关闭功能的网站顶部滑出的广告提示条</title>
<style>
body{margin:0px;padding:0px}
.home_tx {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: url(http://www.codefans.net/jscss/demoimg/201011/hometx_03.gif); PADDING-BOTTOM: 0px; MARGIN: auto; OVERFLOW: hidden; WIDTH: 950px; PADDING-TOP: 0px}
.home_tx IMG {BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; BORDER-RIGHT-WIDTH: 0px}
.home_tx DL {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FLOAT: left; PADDING-BOTTOM: 0px; MARGIN: 0px 10px 0px 0px; WIDTH: 61px; PADDING-TOP: 0px; HEIGHT: 37px}
.home_tx SPAN {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 12px; FLOAT: left; PADDING-BOTTOM: 0px; MARGIN: 0px; WIDTH: 830px; COLOR: #333333; LINE-HEIGHT: 34px; PADDING-TOP: 0px; HEIGHT: 37px; TEXT-ALIGN: left}
.home_tx SPAN B {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: normal; FLOAT: left; PADDING-BOTTOM: 0px; MARGIN: 0px; COLOR: #990000; PADDING-TOP: 0px}
.home_tx A {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FLOAT: right; PADDING-BOTTOM: 0px; MARGIN: 0px; WIDTH: 35px; PADDING-TOP: 0px; HEIGHT: 37px}
</style>
</head>
<body>
<DIV id=home_tx style=”PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: auto; OVERFLOW: hidden; WIDTH: 950px; PADDING-TOP: 0px; POSITION: relative; HEIGHT: 1px”>
<DIV class=home_tx id=home_tx_in style=”POSITION: absolute; TOP: -37px; HEIGHT: 37px” align=center>
<DL><IMG src=”http://myjs.jz123.cn/img/hometx_01.gif”></DL><SPAN><B>团购网站大全-优团网免费收录优秀的诚信的团购网站,欢迎加入。</B>
<A style=”FLOAT: none” href=”http://www.0491.com” target=_blank>详情>></A></SPAN> <A style=”CURSOR: pointer” onfocus=this.blur() onClick=”home_tx_hide();return false;” href=”#”><IMG src=”http://myjs.jz123.cn/img/hometx_04.gif”></A> </DIV></DIV>
<script>
var is_home_tx_show = false;
var div_home_tx = document.getElementById(“home_tx”);
var div_home_tx_in = document.getElementById(“home_tx_in”);
var stepms = 10;
function home_tx_show(){
home_tx_stepshow();
}
function home_tx_stepshow(){
var curHeight = parseInt(div_home_tx.offsetHeight);
if(curHeight>=37){
is_home_tx_show = true;
}else{
div_home_tx.style.height = (curHeight + 4) + “px”;
div_home_tx_in.style.top = (parseInt(div_home_tx_in.style.top)+4)+”px”;
window.setTimeout(home_tx_stepshow,30);
}
}
function home_tx_hide(){
if(is_home_tx_show){
home_tx_stephide()
}else{
window.setTimeout(home_tx_stephide,1200);
}
}
function home_tx_stephide(){
var curHeight = parseInt(div_home_tx.style.height);
if(curHeight<=0){
is_home_tx_show = false;
}else{
try{
div_home_tx.style.height = (curHeight – 4) + “px”;
div_home_tx_in.style.top = (parseInt(div_home_tx_in.style.top)-4)+”px”;
window.setTimeout(home_tx_stephide,30);
} catch(e) {}
}
}
if(window.addEventListener){
window.addEventListener(“load”,home_tx_show,false);
}else{
window.attachEvent(“onload”,home_tx_show);
}
</script>
</body>
</html>

本文固定链接: http://www.web92.net/196.html | WEB前端开发

该日志由 于2012年06月02日发表在 JavaScript 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: 带关闭功能的网站顶部滑出的广告提示条 | WEB前端开发