本代码通过2.5版本测试,一切显示正常,请将以下代码放在首页或者频道页适当位置
提示:请注意广告图片位置的修改(ad/001/b2b_2.jpg )- <!--通栏收缩广告开始 -->
- <script type="text/javascript">
- var intervalId = null;
- function slideAd(id,nStayTime,sState,nMaxHth,nMinHth){
- this.stayTime=nStayTime*1000 || 3000;
- this.maxHeigth=nMaxHth || 200;
- 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:#ff0000;height:12px;overflow:hidden;">
- <a target="_blank"><img src="ad/001/b2b_2.jpg" border="0" /></a>
- </div>
-
- <script type="text/javascript">
- <!--
- slideAd('MyMoveAd',5);
- -->
- </script>
- <table width="960" border="0" cellspacing="0" cellpadding="0" id="jueban" style="background:red;display: ">
- <tr><td height=""><a target="_blank">
- <img src="ad/001/b2b.jpg" border="0"></a></td></tr></table>
- <!--通栏收缩广告结束 -->
复制代码 |