{"id":316745,"date":"2021-02-04T13:55:47","date_gmt":"2021-02-04T05:55:47","guid":{"rendered":"http:\/\/4563.org\/?p=316745"},"modified":"2021-02-04T13:55:47","modified_gmt":"2021-02-04T05:55:47","slug":"%e6%83%b3%e5%9c%a8%e9%a1%b5%e9%9d%a2%e4%b8%8a%e5%a2%9e%e5%8a%a0%e8%b7%9f%e9%9a%8f%e9%bc%a0%e6%a0%87%e7%9a%84%e5%8d%81%e5%ad%97%e7%9e%84%e5%87%86%e7%ba%bf%ef%bc%8c-x-%e7%ba%bf%e5%81%8f%e7%a7%bb","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=316745","title":{"rendered":"\u60f3\u5728\u9875\u9762\u4e0a\u589e\u52a0\u8ddf\u968f\u9f20\u6807\u7684\u5341\u5b57\u7784\u51c6\u7ebf\uff0c X \u7ebf\u504f\u79fb\u4e86\uff0c\u4e0d\u5f97\u5176\u89e3\u3002\u3002\u3002"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u60f3\u5728\u9875\u9762\u4e0a\u589e\u52a0\u8ddf\u968f\u9f20\u6807\u7684\u5341\u5b57\u7784\u51c6\u7ebf\uff0c X \u7ebf\u504f\u79fb\u4e86\uff0c\u4e0d\u5f97\u5176\u89e3\u3002\u3002\u3002               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : qazwsxkevin <\/span>  <span><i><\/i> 10<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<pre><code>    var ox = document.createElement('div');     var oy = document.createElement('div');     ox.style.width = '100%';     ox.style.height = '1px';     ox.style.backgroundColor = '#FF0000';     ox.style.position = 'fixed';     ox.style.left = 0;     document.body.appendChild(ox);     oy.style.height = '100%';     oy.style.width = '1px';     oy.style.backgroundColor = '#FF0000';     oy.style.position = 'fixed';     oy.style.top = 0;     document.body.appendChild(oy);     document.onmousemove = function (e) {         \/\/\u5199\u6cd5\u4e00         var e = e || event;         var x = e.pageX;         var y = e.pageY;          \/\/\u5199\u6cd5\u4e8c         \/\/ var e = e || window.event;  \/\/event \u7684\u517c\u5bb9\u5199\u6cd5         \/\/ var x = e.pageX || e.clientX + scroll().left;  \/\/\u83b7\u53d6 pageX \u7684\u517c\u5bb9\u5199\u6cd5         \/\/ var y = e.pageY || e.clientY + scroll().top;          ox.style.top = y + 'px';         oy.style.left = x + 'px';     };      \/\/\u5199\u6cd5\u4e8c\u8981\u7528\u5230\u7684\u51fd\u6570     function scroll() {         return {             \"top\": window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop,             \"left\": window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft         }     } <\/code><\/pre>\n<p>Y \u7ebf\u662f\u6b63\u5e38\u8ddf\u968f\u9f20\u6807\u7684\uff0cX \u8f74\u5411\u4e0b\u504f\u79fb\u4e86\u534a\u4e2a\u5c4f\u5e55\uff0c\u8bf7\u6559\u5927\u5bb6\u95ee\u9898\u6240\u5728\uff1f<br \/> \u76ee\u524d\u53ea\u8bd5\u8fc7 IE \u548c Firefox\uff0c\u5e94\u8be5\u4e0d\u662f\u517c\u5bb9\u95ee\u9898\uff1f \u53ea\u60f3\u5728 Firefox \u4e0a\u80fd\u8dd1\u5c31\u53ef\u4ee5\u4e86\u3002\u3002\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>5<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4974799\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : IsaacYoung <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/developer.mozilla.org\/zh-CN\/docs\/Web\/API\/MouseEvent\/pageX<\/p>\n<p> pageX \u662f\u4e00\u4e2a\u7531 MouseEvent \u63a5\u53e3\u8fd4\u56de\u7684\u76f8\u5bf9\u4e8e\u6574\u4e2a\u6587\u6863\u7684 x \uff08\u6c34\u5e73\uff09\u5750\u6807\u4ee5\u50cf\u7d20\u4e3a\u5355\u4f4d\u7684\u53ea\u8bfb\u5c5e\u6027\u3002<\/p>\n<p>\u8fd9\u4e2a\u5c5e\u6027\u5c06\u57fa\u4e8e\u6587\u6863\u7684\u8fb9\u7f18\uff0c\u8003\u8651\u4efb\u4f55\u9875\u9762\u7684\u6c34\u5e73\u65b9\u5411\u4e0a\u7684\u6eda\u52a8\u3002\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u5982\u679c\u9875\u9762\u5411\u53f3\u6eda\u52a8 200px \u5e76\u51fa\u73b0\u4e86\u6eda\u52a8\u6761\uff0c\u8fd9\u90e8\u5206\u5728\u7a97\u53e3\u4e4b\u5916\uff0c\u7136\u540e\u9f20\u6807\u70b9\u51fb\u8ddd\u79bb\u7a97\u53e3\u5de6\u8fb9 100px \u7684\u4f4d\u7f6e\uff0cpageX \u6240\u8fd4\u56de\u7684\u503c\u5c06\u662f 300 \u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4974800\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xiaoming1992 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u53ef\u4ee5\u76f4\u63a5\u66f4\u6362\u9f20\u6807\u6837\u5f0f\u554a\uff0c\u4e0d\u662f\u66f4\u8f7b\u91cf\u5417                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4974801\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : qazwsxkevin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @IsaacYoung \u660e\u767d\u4e86\uff0c\u611f\u8c22\uff0c\u4fee\u6b63\u8fc7\u6765\u4e86<\/p>\n<p>@xiaoming1992 \u8868\u7684\u7eb5\u6a2a\u6bd4\u8f83\u5e7f\u9614\uff08 64X128 \uff09\uff0c\u7b2c\u4e00\u5217\u662f\u5e8f\u53f7\uff0c\u7b2c\u4e00\u884c\u662f\u6807\u9898\u680f\uff0c\u6ca1\u6709\u5341\u5b57\u7ebf\uff0c\u4f1a\u773c\u82b1\u7684\u3002<\/p>\n<p>\u672c\u6765\u8fd8\u60f3\u7740\u843d\u5230\u8868\u683c\u7684\u683c\u5b50\u4e0a\uff0c\u5bf9\u5e94 X,Y \u7684\u5e8f\u53f7\u548c\u6807\u9898\u680f\u9ad8\u4eae\u7684\uff0c\u7ed3\u679c\u770b\u8d77\u6765\uff0c\u8fd8\u662f\u5341\u5b57\u7ebf\u6bd4\u8f83\u9760\u8c31\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4974802\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xeaglex <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             [https:\/\/www.w3school.com.cn\/cssref\/pr_class_cursor.asp]( https:\/\/www.w3school.com.cn\/cssref\/pr_class_cursor.asp)                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4974803\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : MENGKE <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5e94\u8be5\u4e3a clientX \u548c clientY                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u60f3\u5728\u9875\u9762\u4e0a\u589e\u52a0\u8ddf\u968f\u9f20\u6807\u7684\u5341\u5b57\u7784\u51c6\u7ebf&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/316745"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=316745"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/316745\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=316745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=316745"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=316745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}