日期:2014-05-17  浏览次数:20670 次

javascript 控制显示隐藏如何实现
本帖最后由 huxiweng 于 2013-11-01 15:09:26 编辑
huxiweng 版主,刚才那个按钮我给加上了,remove我查看了,是清除功能,那如果我还要再展开应该是什么呢,我试了上面代码的display或者重新加载网页都不行,请指导一下

谢谢你的帮助,还请问这种网页的代码编写我应该看什么书来学习?

------解决方案--------------------

------解决方案--------------------
大概改了下。里面还需要重写 。有些会有冲突的。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-

transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Introduction to the GNSS and LBS Association of China</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>482)  //高度
        {
            return;
        }
        document.getElementById("ads").style.display = "";
        document.getElementById("ads").style.height = h+"px";
        setTimeout("addCount()",30); 
    }
     
    window.onload = function showAds()
    {
        addCount();
        setTimeout("noneAds()",40000); //停留时间自己适当调整
    }
    </script>
     
    <script type="text/javascript" language="javascript">
    var T = 260;
    var N = 260; //高度
    function noneAds()
    {
        if(T>0)
        {
            T--;
            N = N-5;
     &nbs