网站首页顶部经典的自动伸缩的滑动广告(非常漂亮)展示效果非常好
本帖最后由 灰儿 于 2011-12-6 17:41 编辑安装:把代码下下来复制到 <body> </body>开头就可以了
<!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>
<meta name="Generator" content="NO" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords" content="" />
<meta name="Description" content="" />
<title></title>
</head>
<body>
<center>
<script type="text/javascript">
var intervalId = null;
function slideAd(id,nStayTime,sState,nMaxHth,nMinHth){
this.stayTime=nStayTime*1000 || 3000;
this.maxHeigth=nMaxHth || 442;
this.minHeigth=nMinHth || 2.5;
this.state=sState || "down" ;
var obj = document.getElementById(id);
if(intervalId != null)window.clearInterval(intervalId);
function openBox(){
var h = obj.offsetHeight;
obj.style.height = ((this.state == "down") ? (h + 2) : (h - 2))+"px";
if(obj.offsetHeight>this.maxHeigth){
window.clearInterval(intervalId);
intervalId=window.setInterval(closeBox,this.stayTime);
}
if (obj.offsetHeight<this.minHeigth){
window.clearInterval(intervalId);
obj.style.display="none";
}
}
function closeBox(){
slideAd(id,this.stayTime,"up",nMaxHth,nMinHth);
}
intervalId = window.setInterval(openBox,30);
}
</script>
<div id="MyMoveAd" style="background:#022811;height:12px;overflow:hidden; margin-top:0px;">
<a href="http://shop37057964.taobao.com" target="_blank"><img src="http://www.taobaoshi.com/baner_3.jpg" border="0" /></a>
</div>
<script type="text/javascript">
<!--
slideAd('MyMoveAd',5);
-->
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="jueban" style="background:#022811;margin-top:0px;display: ">
<tr><td height=""><a href="http://shop37057964.taobao.com" target="_blank"><img src="http://www.taobaoshi.com/baner_5.jpg" border="0" /></a></td>
</tr></table>
</center>
</body>
</html>
有空俺试试!:)
页:
[1]