滑动展开/收缩广告代码
演示地址:http://www.souab.com/Demo/200907/Expansion/
<!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" lang="gb2312">
<head>
<title> 代码实例:滑动展开/收缩广告_不懂戀愛魚兒</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<meta name="keywords" content="代码实例:滑动展开/收缩广告" />
<script type="text/javascript">
var intervalId = null;
function slideAd(id,nStayTime,sState,nMaxHth,nMinHth){
this.stayTime=nStayTime*2000 || 3000; //此处设置时间
this.maxHeigth=nMaxHth || 90;
this.minHeigth=nMinHth || 1;
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,10);
}
</script>
<style type="text/css">
<!--
html{
background:#FFF;
}
body{
font:12px Verdana,Arial,Tahoma;
}
img{
border:none;
}
ul,li{
list-style:none;
}
-->
</style>
</head>
<body style="margin:0;padding:0;font-size:14px;">
<div id="MyMoveAd" style="background:#fff;height:12px;overflow:hidden;">
<ul>
<li><img src="Img.gif"></li>
</ul>
</div>
<p align="center" style="padding:10px;">代码实例:<strong>滑动展开/收缩广告</strong>请刷新页面,再次观看演示效果</p>
<script type="text/javascript">
<!--
slideAd('MyMoveAd',2);
-->
</script>
<BR><BR>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><script type="text/javascript"><!--
google_ad_client = "pub-2176993388255317";
/* 728x90, 创建于 09-3-30 */
google_ad_slot = "7010104479";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
</tr>
<tr>
<td height="8"></td>
</tr>
<tr>
<td align="center"><script type="text/javascript"><!--
google_ad_client = "pub-2176993388255317";
/* 728x15, 创建于 09-2-28 */
google_ad_slot = "7729442397";
google_ad_width = 728;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></td>
</tr>
<tr>
<td height="8"></td>
</tr>
<tr>
<td align="center"><script type="text/javascript"><!--
google_ad_client = "pub-2176993388255317";
/* 728x90, 创建于 09-3-29 */
google_ad_slot = "3221108693";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></td>
</tr>
</table>
</body>
</html>
Expansion.rar 85.61KB
最新评论
强大!
The purchases I make...
At last! Somonee who...
Good job mkanig it a...
How neat! Is it real...
Unparalleled accurac...
Thanky Thanky for al...
That's an inenguios ...
Holy szhinit, this i...
If you wrote an atri...