本人很需要这个,找了好久,找到了发在discuz 6.0 帖子里的,拿过来用了一下可以用。希望大家也有用。
将以下代码插入你的模板<body></body> 之间,自己整2个图片,后台更新缓存就可以了
- <center>
- <script type="text/javascript">
- var intervalId = null;
- function slideAd(id,nStayTime,sState,nMaxHth,nMinHth){
- this.stayTime=nStayTime*800 || 3000;
- this.maxHeigth=nMaxHth || 215;
- 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:#FFFFFF;height:12px;overflow:hidden; margin-top:0px;">
- <a href="#" target="_blank"><img src="http://www.09118.net/home/images/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:#FFFFFF;margin-top:0px;display: ">
- <tr><td height=""><center><a href="http://www.09118.net/home/happyfarm.php" target="_blank"><img src="http://www.09118.net/home/images/baner_5.jpg" border="0" /></center></a></td>
- </tr></table>
- </center>
复制代码 |