• 鼠标跟随提示框


    鼠标移入某区域中鼠标右下角显示提示信息:

    $(document).ready(function(){
    // 创建一个div显示提示信息
    var dropTitle = document.createElement("div");
    dropTitle.id= "backdropTitle";
    dropTitle.style.backgroundColor="#fff";
    dropTitle.innerHTML="提示信息";
    document.getElementsByTagName('body')[0].appendChild(dropTitle);

    // 鼠标移入遮罩层事件
    var backdropTitle = document.getElementById("backdropTitle");
    var backdropBorderS = document.getElementsByClassName("backdrop-border");
    backdropTitle.style.display = "none";
    for(var i=0,len=backdropBorderS.length;i<len;i++){
    backdropBorderS[i].onmousemove = function(evt) {
    var oEvent = evt || window.event;
    var scrollleft = document.documentElement.scrollLeft || document.body.scrollLeft;
    var scrolltop = document.documentElement.scrollTop || document.body.scrollTop;
    backdropTitle.style.display = "block";
    backdropTitle.style.position = "absolute";
    backdropTitle.style.left = oEvent.clientX + scrollleft + 10 + "px";
    backdropTitle.style.top = oEvent.clientY + scrolltop + 10 + "px";
    backdropTitle.style.zIndex = "2060";
    setTimeout(function(){
    backdropTitle.style.display = "none";
    },6000);
    };
    backdropBorderS[i].onmouseout = function (){
    backdropTitle.style.display = "none";
    }
    }
    });
  • 相关阅读:
    成功后的迷失
    让主参与的人生
    生命的见证
    谁偷走了我的安全感
    简单理解分页原理
    WebApp开发入门
    程序员必需知道的搜索引擎的搜索技巧
    提高网页打开速度技巧
    十分钟了解HTTP协议
    简单实现页面临摹设计图功能
  • 原文地址:https://www.cnblogs.com/qhhw/p/6165507.html
Copyright © 2020-2023  润新知