找回密码
 注册
首页 ≡≡网络技术≡≡ WEB前端 网站首页顶部经典的自动伸缩的滑动广告(非常漂亮)展示 ...

网站首页顶部经典的自动伸缩的滑动广告(非常漂亮)展示效果非常好

灰儿 2011-12-6 17:40:59
本帖最后由 灰儿 于 2011-12-6 17:41 编辑

安装:把代码下下来复制到 <body> </body>开头就可以了


  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta name="Generator" content="NO" />
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta name="Keywords" content="" />
  7. <meta name="Description" content="" />
  8. <title></title>
  9. </head>
  10. <body>
  11. <center>
  12. <script type="text/javascript">
  13. var intervalId = null;
  14. function slideAd(id,nStayTime,sState,nMaxHth,nMinHth){
  15. this.stayTime=nStayTime*1000 || 3000;
  16. this.maxHeigth=nMaxHth || 442;
  17. this.minHeigth=nMinHth || 2.5;
  18. this.state=sState || "down" ;
  19. var obj = document.getElementById(id);
  20. if(intervalId != null)window.clearInterval(intervalId);
  21. function openBox(){
  22. var h = obj.offsetHeight;
  23. obj.style.height = ((this.state == "down") ? (h + 2) : (h - 2))+"px";
  24. if(obj.offsetHeight>this.maxHeigth){
  25. window.clearInterval(intervalId);
  26. intervalId=window.setInterval(closeBox,this.stayTime);
  27. }
  28. if (obj.offsetHeight<this.minHeigth){
  29. window.clearInterval(intervalId);
  30. obj.style.display="none";
  31. }
  32. }
  33. function closeBox(){
  34. slideAd(id,this.stayTime,"up",nMaxHth,nMinHth);
  35. }
  36. intervalId = window.setInterval(openBox,30);
  37. }
  38. </script>
  39. <div id="MyMoveAd" style="background:#022811;height:12px;overflow:hidden; margin-top:0px;">
  40. <a href="http://shop37057964.taobao.com" target="_blank"><img src="http://www.taobaoshi.com/baner_3.jpg" border="0" /></a>
  41. </div>
  42. <script type="text/javascript">
  43. <!--
  44. slideAd('MyMoveAd',5);
  45. -->
  46. </script>
  47. <table width="100%" border="0" cellspacing="0" cellpadding="0" id="jueban" style="background:#022811;margin-top:0px;display: ">
  48. <tr><td height=""><a href="http://shop37057964.taobao.com" target="_blank"><img src="http://www.taobaoshi.com/baner_5.jpg" border="0" /></a></td>
  49. </tr></table>
  50. </center>
  51. </body>
  52. </html>
复制代码

动物医疗 2011-12-6 18:07:11
有空俺试试!
您需要登录后才可以回帖 登录 | 注册
学习中心
站长自定义文字内容,利用碎片时间,随时随地获取优质内容。
Q设计语言 了解更多
Q Design 提供商家设计所需的指导与资源,帮商家快速完成产品设计、降低生产成本。
学习中心
站长自定义文字内容,利用碎片时间,随时随地获取优质内容。
Q设计语言 了解更多
Q Design 提供商家设计所需的指导与资源,帮商家快速完成产品设计、降低生产成本。