日期:2014-05-16  浏览次数:20284 次

sleep 之后 div 没有显示
HTML code
<html>
<head>
</head>

<body>
    <div id="login" >
        aaa
    <div>
    <div id="select_name" style="display:none">
        bbb
    <div>
    <script>
    var sleep_int = self.setInterval("login_sleep()",10000);
    function login_sleep () {
        document.getElementById("login").style.display = "none";
        document.getElementById("select_staff_name").style.display = "block";
        window.clearInterval(sleep_int);
    }
    </script>
</body>
</html>


select_name 这个 div 一开始是隐藏的,在经过一段时间收 吧 login 这个 div 隐藏掉,显示select_name这个,login隐藏掉了,但select_name没有显示,怎么把 select_name 显示出来呢???

------解决方案--------------------
你的html写错了
应该是

<div id="login">
aaa
</div>
<div id="select_name" style="display: none">
bbb
</div>


注意结束标记