• JavaScript实现延时提示框


    <html>
    <head>
    <meta charset="utf-8">
    <title>无标题文档</title>
    <style type="text/css">
        #div1 {
            width: 50px;
            height: 50px;
            background: red;
            margin: 10px;
            display: block;
        }
        #div2 {
            width: 300px;
            height: 300px;
            background: #868282;
            display: none;
        }
    </style>
    </head>
    <body>
    <div id="div1"></div>
    <div id="div2"></div>
    <script>
        var odiv1=document.getElementById('div1');
        var odiv2=document.getElementById('div2');
        var timer=null;
        odiv1.onmouseover=odiv2.onmouseover=function()
        {
            clearTimeout(timer);  /*当鼠标移到div2时关闭定时器*/
            odiv2.style.display='block';
        }
        odiv1.onmouseout=odiv2.onmouseout=function()
        {
            timer=setTimeout(
            function()
            {
                odiv2.style.display='none';
            },1000);   /*1秒后再消失*/
        }
    </script>
    </body>
    </html>
  • 相关阅读:
    游记&退役记
    Nothing to say
    学习知识点的比较好的blog
    计划做题列表
    后缀自动机小专题
    复数
    FFT学习
    P2900 [USACO08MAR]土地征用Land Acquisition
    # 数位DP入坑
    Hdu 4035 Maze(概率DP)
  • 原文地址:https://www.cnblogs.com/xinlvtian/p/7929405.html
Copyright © 2020-2023  润新知