zoukankan      html  css  js  c++  java
  • 体会事件对象

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
        <title>Document</title>
    </head>
    <body>
    
    </body>
    </html>
    <script>
       document.onclick=function (event) //event是事件对象
       {
          console.log(event.clientX); //返回事件对象(document)的x坐标 ,这种写法ie678不兼容
          console.log(event.clientY);  //返回事件对象(document整个文档)的y 坐标
           console.log(window.event.clientX);//ie678的写法
    
           var event=event || window.event; //兼容式写法
           console.log(event.clientX);
           console.log(event.clientY);
           console.log(pageXOffset);//光标相对于该网页的水平位置
           console.log(screenX);//光标相对于电脑屏幕的水平位置
       }
    </script>
    

      

  • 相关阅读:
    稠密光流
    分水岭分割
    Haar小波分析
    内积空间
    矩阵LU分解
    opencv笔记---contours
    Deformable Templates For Eye Detection
    最小二乘法
    字符集及编码
    层次聚类
  • 原文地址:https://www.cnblogs.com/shanlu0000/p/11241002.html
Copyright © 2011-2022 走看看