北京网店建设
网站地图
RSS订阅
匿名投稿
开网店送空间和顶级域名
您的位置:北京网店建设 > 网店建设 > ecshop模板制作

ecshop模板|仿凡客模板的首页滑动广告

作者:admin 来源:未知 日期:2009-12-20 12:05:15 人气: 标签:ecshop免费模板 ecshop模板 ecshop模板制作 ecshop模板开发 ecshop模板操作
导读:第一步:引入JS,在index.dwt文件的</head>前面添加如下代码:<SCRIPT language=javascript type=text/javascript>var hmax = 340;//最大高度var&n
第一步:
引入JS,在index.dwt文件的</head>前面添加如下代码
  1. <SCRIPT language=javascript type=text/javascript>
  2. var hmax = 340;//最大高度
  3. var hmin = 100;//最小高度
  4. var h=0;
  5. function addCount(){
  6. {
  7.   h=hmax;
  8.   setTimeout("noneAds()",1000); //停留时间自己适当调整 1000 = 1秒
  9.   document.getElementById("adsOPEN").style.display = "none";
  10. }
  11. document.getElementById("ads").style.display = "";
  12. document.getElementById("ads").style.height = h+"px";
  13. }
  14. window.onload = function showAds(){
  15. document.getElementById("ads").style.display = "none";
  16. document.getElementById("ads").style.height = "0px";

  17. addCount(); //慢慢打开
  18. // h=hmax;
  19. // setTimeout("noneAds()",1000); //停留时间自己适当调整 1000 = 1秒
  20. }
  21. function openAds(){
  22. h = 0;//高度
  23. addCount(); //慢慢打开
  24. }
  25. function noneAds(){
  26. if(h>hmin) {
  27.   h -= 5;
  28.   setTimeout("noneAds()",1);
  29. }
  30. else {
  31.   h = hmin;
  32.   document.getElementById("ads").style.display = "none";
  33.   document.getElementById("adsOPEN").style.display = "";
  34.   return;
  35. }
  36. document.getElementById("ads").style.height = h+"px";
  37. }
  38. </SCRIPT>
复制代码
第二步:在index.dwt中,你需要显示广告的位置插入如下代码:
  1. <DIV id=ads style="OVERFLOW: hidden; TOP: 0px; TEXT-ALIGN: center; margin:10px">
  2. <IMG src="/images/max.jpg">
  3. </DIV>
  4. <DIV id=adsOPEN style="OVERFLOW: hidden; TEXT-ALIGN: center; display:none; margin-top:10px;">
  5.   <IMG src="/images/min.jpg" border=0>
  6. </DIV>
复制代码
大功告成,因是公司的网站,所以这里就不放演示了,安装成功的留个演示地址
本文连接地址:http://www.511sj.com/html/wangdianjianshe/ecshop_mobanzhizuo/207.Html

编辑整理:北京网店建设 ecshop模板 ecshop模板

共有:条评论信息评论信息
发表评论
姓 名:
验证码: