zoukankan      html  css  js  c++  java
  • 悬浮框

     //获取鼠标悬浮位置的坐标
        function mousePosition(e) 
        { 
            var x = "";
            var y = "";
            if(e.pageX && e.pageY) {
                x = e.pageX;
                y= e.pageY;
            }
            var scrollElem = (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
            x = e.clientX + scrollElem.scrollLeft;
            y= e.clientY + scrollElem.scrollTop;
            
        }
    获取鼠标各种事件触发位置的坐标

    这段时间再弄悬浮框,很简单的效果,记录下,防止忘记

     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">  
     <HTML>  
      <style>  
       #hint{  
        198px;  
        border:1px solid #000000;  
        background:#99ff33;  
        position:absolute;  
        z-index:9;  
        padding:6px;  
        line-height:17px;  
        text-align:left;   
       }  
      </style>  
      <SCRIPT LANGUAGE="JavaScript">  
       <!--  
        function showme(){  
         var oSon = window.document.getElementById("hint");  
         if (oSon == null) return;  
         with (oSon){  
          
          style.display = "block";  
          style.pixelLeft = window.event.clientX + window.document.body.scrollLeft + 6;  
       
          style.pixelTop = window.event.clientY + window.document.body.scrollTop + 9;  
       
         }  
        }  
        function hidme(){  
         var oSon = window.document.getElementById("hint");  
         if(oSon == null) return;  
         oSon.style.display="none";  
        }  
       //-->  
      </SCRIPT>  
      <BODY>  
       <text id="guoguo" value="ga">  
    
       <a href="#" onmouseover="showme()" onmouseout="hidme()" onmousemove="showme()">dfdfd</a>
    
       <div id="hint" style="display:none"></div>  
      </BODY>  
     </HTML> 
  • 相关阅读:
    C#与C++与互操作
    WPF GridView动态添加项并读取数据
    C#使用消息队列(MSMQ)
    使用代码浏览WPF控件模版
    PowerShell将运行结果保存为文件
    opencv + ffmpeg
    vmware
    HttpComponents Downloads
    pytorch 安装
    opencv 3.4.0 的编译
  • 原文地址:https://www.cnblogs.com/bobo-pcb/p/3922145.html
Copyright © 2011-2022 走看看