门户通之完美去弹窗+伸缩广告的代码加入方法(不占广告位)
9月14号门户通正式推出产品推广联盟,一但审核通过将人工帮你去掉广告,但是由于推出的广告种类很少,很占网站广告位,
在这里公布一个既合法又不占用你任何广告位的代码 ,这是门户通论坛里一会会员提供的,还被管理员置为精华的文章,具体加入代码那需要你更具自己的需要改成你自己的,相信这个很简单吧!
演示地址:http://www.9zys.com
<tr><td><!--顶部伸缩广告开始-->
<center>
<script
type="text/javascript">
var intervalId = null;
function
slideAd(id,nStayTime,sState,nMaxHth,nMinHth){
this.stayTime=nStayTime*3800 || 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>
</head>
<div id="MyMoveAd"
style="background:#fff;height:12px;overflow:hidden;">
<center><a
href="<A
href="http://www.51.net/?mid=52s.net.ru">http://www.51.net/?mid=52s.net.ru"
target=_blank> <img src="<A
href="http://image.51.net/950-1.gif">"
border="0"></a></center>
</div>
<script type="text/javascript">
<!--
slideAd('MyMoveAd',2);
-->
</script>
</center>
<!--顶部伸缩广告代码结束-->