产品使用及交流论坛

首页 » 产品使用交流区 » 安装及使用交流 » 如何在首页增加像网易首页那样的效果?
wc1231 - 2010/7/10 13:07:00
就是一打开页面,一老大的广告出来,然后几秒后自行消失,也可点广告上的“关闭”来马上关闭它,请教如何实现这样的效果呀?
wc1231 - 2010/7/12 9:04:00
有高手愿意教一下吗?感激涕零!
wc1231 - 2010/7/12 10:44:00
我在网上找了一段代码,却不知如何插入首页,代码如下:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>像163网站顶部展出的大幅广告</title>
   <script type="text/javascript" language="javascript">
    var time = 500;
    var h = 0;
    function addCount()
    {
        if(time>0)
        {
            time--;
            h = h+5;
        }
        else
        {
            return;
        }
        if(h>=500)  //高度
        {
            return;
        }
        document.getElementById("ads").style.display = "";
        document.getElementById("ads").style.height = h+"px";
        setTimeout("addCount()",30);
    }
    
    window.onload = function showAds()
    {
        addCount();
        setTimeout("noneAds()",8000); //停留时间自己适当调整
    }
    </script>
    
    <script type="text/javascript" language="javascript">
    var T = 500;
    var N = 500; //高度
    function noneAds()
    {
        if(T>0)
        {
            T--;
            N = N-5;
        }
        else
        {
            return;
        }
        if(N<=0)
        {
            document.getElementById("ads").style.display = "none";
            return;
        }
        
        document.getElementById("ads").style.height = N+"px";
        setTimeout("noneAds()",30);
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="ads" style="margin:auto; display:none; width:100%; top:0px; height:0px; border:solid 1px #000; background-color:#fafafa; position:relative; overflow:hidden; text-align:center;">
        <img src="1.gif" width="100%"  alt="" /><div id="close" style="position:absolute; right:50px; bottom:20px; cursor:hand;" >
<img src='close.gif' onClick='javascript:document.getElementById("ads").style.display = "none";document.getElementById("close").style.display = "none"' width='100' height='14' border='0' vspace='3' alt='关闭广告'></div>
    </div>

    <div style="margin:auto; width:100%; height:200px; border:solid 1px #000; background-color:#fafafa; text-align:center;">
        网站主体内容
    </div>
<table><tr><td style="position:relative">

</td></tr></table>
    </form>
</body>
</html>
请高手指点一下,谢谢!
wc1231 - 2010/7/15 14:39:00
这种如网易新浪首页一开始出现的那种大画面停几秒消失或手动消失的效果,有高手能教教如何实现吗?
wc1231 - 2010/7/16 10:36:00
是不是要系统本身修改才能实现呀?
1
查看完整版本: 如何在首页增加像网易首页那样的效果?