zoukankan      html  css  js  c++  java
  • js鼠标进入,延迟显示提示框

    鼠标进入,延迟显示提示框

    <!DOCTYPE html>
        <html lang="en">
        <head>
            <meta charset="UTF-8">
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <title>鼠标进入,延迟显示提示框</title>
            <style>
                .box{
                     500px;
                    height: 500px;
                    border: 1px solid black;
                    position: relative;
                }
                #txt{
                    display: none;
                     200px;
                    height: 30px;
                    line-height: 30px;
                    border: 1px solid pink;
                    position: absolute;
                    right: 10px;
                }
            </style>
        </head>
        <body>
            <div class="box">
                鼠标进入,延迟显示提示框
            <p id="txt">
                提示框
            </p>
        </div>
        </body>
            <script>
                var obox=document.querySelector(".box");
                var otxt=document.getElementById("txt")
                var t;
                obox.onmouseover=function(){
                    clearTimeout(t)
                    t = setInterval(function(){
                    otxt.style.display="block";
                },500)
                }
                obox.onmouseout = function(){
                    clearTimeout(t)
                    otxt.style.display="none"
                }
            </script>
        </html>
    请用今天的努力,让明天没有遗憾。
  • 相关阅读:
    HOW TO MAKE IT FLOW ?
    ansys14.0 从入门到精通
    ansys 14.0
    C++ GUI Qt4 编程 (第二版)
    零基础学QT编程
    医学成像与医学图像处理
    曾巩传
    c++ 编程调试秘笈
    matlab实用教程
    不要重复发明轮子-C++STL
  • 原文地址:https://www.cnblogs.com/cupid10/p/15617776.html
Copyright © 2011-2022 走看看