| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 986 人关注过本帖
标题:在线等关于首页顶部收缩广告代码问题,快疯了
只看楼主 加入收藏
cnwoe
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2007-7-31
收藏
 问题点数:0 回复次数:1 
在线等关于首页顶部收缩广告代码问题,快疯了
<script src="taobao/a.js"></script>

<div id="topAds_chk_show" style="margin-top:0px; margin-bottom:0px; width:956px; display:block;">
<a href="http://shop35576578. target="_blank">
<img src="taobao/shou3.gif" width="900" height="40" border="0" /></a><a href="javascript:close_chk_show();"><img src="taobao/shou4.gif" width="52" height="40" border="0" alt="关闭" /></a>
</div>

调用的JS文件内容为以下
function checktopAds()
{   
   
   return true;   
}

function do_it()
{
  if ( checktopAds() )
  {
  var anim = function()
    {
      n += 5;
        if(n >= 45){
        document.getElementById('topAds_chk_show').style.marginTop = "0";
        window.clearInterval(t1);
        }else{
        document.getElementById('topAds_chk_show').style.marginTop = "-"+(45 - n)+"px";
        }
      },n=0;
      var t1 = window.setInterval(anim,80);
    }
}

function close_chk_show()
{

  var anim = function()
  {
    n += 5;
    if(n >= 45){
    document.getElementById('topAds_chk_show').style.marginTop = "-45px";
    window.clearInterval(t1);
    }else{
    document.getElementById('topAds_chk_show').style.marginTop = "-"+ n +"px";
    }
  },n=0;

    var t1 = window.setInterval(anim,80);
}

问题现在就是我想在这个广告载入时是有动感的慢慢载入,就像关闭时慢慢退出一样,上面这代码是打开主页就显示广告,我要的效果就像支付宝(https://www.)首页的那个收缩广告一样,而且我还想加一句可以在一定时间内自己关闭广告慢慢退出的效果,求大家帮帮忙,在这感激不尽!
搜索更多相关主题的帖子: 广告 首页 顶部 代码 在线 
2008-06-29 19:17
天涯听雨
Rank: 2
来 自:东莞
等 级:论坛游民
威 望:4
帖 子:497
专家分:64
注 册:2007-8-25
收藏
得分:0 
调用方法:<script language=javascript src="/Js/JS名.js"></script>

JS代码:

document.write('<DIV align=center ID="hiddenLayer" style="display: none;">');
document.write('<img src="http://www. border=0 width="990" height="555" alt="为汶川地震中遇难同胞志哀!" align=top></DIV>');

function changediv()
{document.getElementById('hiddenLayer').style.display = "block";setTimeout("hidediv()",12000);}

function hidediv(){document.getElementById('hiddenLayer').style.display="none";SYtag=2;}

function showfull(){setTimeout("changediv()",3000);}

showfull();

从明天起做幸福的人,喂马劈柴周游世界!
2008-06-30 16:40
快速回复:在线等关于首页顶部收缩广告代码问题,快疯了
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017993 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved