<div class="1">
...
隐藏
</div><div class="2">
...
</div>
有上面二个div,第一个div内有个隐藏图标
1 一进页面时,就显示第一个div,再过 10秒钟 就显示第二个div
2 如出现第一个div时,还未过 10秒钟时,用户点了第一个div中的隐藏时,也要出现第二个div.
这怎么实现呀,谢谢

解决方案 »

  1.   

    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>test</title>
    <script type="text/javascript">
    window.onload=function(){
    var obj1=document.getElementById("obj1");
    var obj2=document.getElementById("obj2");
    setTimeout(c,3000);
    }
    function c(){
    obj1.style.display="none";
    obj2.style.display="";
    }
    </script>
    </head><body>
    <div id="obj1" style="background:#CCC;"><span style="cursor:pointer" onclick="c()">点我就隐藏</span><br /><br />这是DIV1</div>
    <div id="obj2" style="background:#F00; display:none;"><br /><br />div2<br /><br /></div>
    </body>
    </html>