• 鼠标跟随提示框


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

    $(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";
    }
    }
    });
  • 相关阅读:
    PAT 1053 住房空置率
    PAT 1078 字符串压缩与解压
    PAT 1024 科学计数法
    HDU 2078 复习时间
    HDU 2065 "红色病毒"问题
    网络协议分析
    多线程同步
    多线程程序设计
    消息队列通讯
    共享内存通讯
  • 原文地址:https://www.cnblogs.com/qhhw/p/6165507.html
Copyright © 2020-2023  润新知