码迷,mamicode.com
首页 > 其他好文 > 详细

延时提示框

时间:2015-08-02 19:57:58      阅读:102      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style type="text/css">
        #div1
        {
            width: 50px;
            height: 50px;
            background: red;
            float: left;
        }
        #div2
        {
            width: 200px;
            height: 200px;
            background: gray;
            float: left;
            margin-left: 20px;
            display: none;
        }
    </style>
    <script type="text/javascript">
         window.onload = function ()
         {
             var oDiv1 = document.getElementById(div1);
             var oDiv2 = document.getElementById(div2);
             oDiv2.onmouseover = oDiv1.onmouseover = function ()
             {
                 oDiv2.style.display = block;
                 clearInterval(timer);
             };
             oDiv2.onmouseout = oDiv1.onmouseout = function ()
             {
                 timer = setInterval(function () {
                     oDiv2.style.display = none;
                 },1000);

             };

         };

    </script>
</head>
<body>
<div id="div1"></div>
<div id="div2"></div>

</body>
</html>

 

延时提示框

标签:

原文地址:http://www.cnblogs.com/zhuni/p/4696567.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!