{"id":58,"date":"2013-01-29T11:42:26","date_gmt":"2013-01-29T03:42:26","guid":{"rendered":"http:\/\/weitaoc.com\/?p=58"},"modified":"2013-01-29T17:38:52","modified_gmt":"2013-01-29T09:38:52","slug":"%e5%85%b3%e4%ba%8e%e6%b5%ae%e5%8a%a8%e5%b1%82%e7%bb%9d%e5%af%b9%e4%bd%8d%e7%bd%ae%e7%9a%84%e7%9b%b8%e5%af%b9%e5%ae%9a%e4%bd%8d","status":"publish","type":"post","link":"http:\/\/weitaoc.com\/?p=58","title":{"rendered":"\u5173\u4e8e\u6d6e\u52a8\u5c42\u7edd\u5bf9\u4f4d\u7f6e\u7684\u76f8\u5bf9\u5b9a\u4f4d"},"content":{"rendered":"<p>\u6709\u4e9b\u65f6\u5019\uff0c\u6211\u4eec\u9700\u8981\u4e00\u4e9b\u5c42\u60ac\u6d6e\u5728\u67d0\u4e00\u4e2a\u56fa\u5b9a\u7684div\u5c42\u7684\u76f8\u5bf9\u4fbf\u5b9c\u4f4d\u7f6e\uff0c\u6bd4\u5982\uff1a<\/p>\n<p><a href=\"http:\/\/weitaoc.com\/?attachment_id=59\" rel=\"attachment wp-att-59\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-59\" alt=\"6\" src=\"http:\/\/weitaoc.com\/wp-content\/uploads\/2013\/01\/61-300x40.jpg\" width=\"300\" height=\"40\" srcset=\"http:\/\/weitaoc.com\/wp-content\/uploads\/2013\/01\/61-300x40.jpg 300w, http:\/\/weitaoc.com\/wp-content\/uploads\/2013\/01\/61.jpg 556w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u4e0b\u9762\u7684\u9ec4\u8272\u6ce8\u91ca\u6846\uff0c\u6211\u4eec\u5982\u4f55\u505a\u5462\uff1f<\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528offset*\u6765\u5b9e\u73b0\uff0c\u7b80\u5355\u63d0\u4f9b\u4e00\u4e0b\u4ee3\u7801\u5427\uff1a<\/p>\n<div class=\"codecolorer-container javascript geshi\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/><\/div><\/td><td><div class=\"javascript codecolorer\" style=\"white-space:nowrap\">document.<span style=\"color: #660066;\">getElementById<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #3366CC;\">'adminlogin'<\/span><span style=\"color: #009900;\">&#41;<\/span>.<span style=\"color: #660066;\">style<\/span>.<span style=\"color: #660066;\">left<\/span><span style=\"color: #339933;\">=<\/span>elemOffset1<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #3366CC;\">'content'<\/span><span style=\"color: #009900;\">&#41;<\/span>.<span style=\"color: #660066;\">x<\/span><span style=\"color: #339933;\">+<\/span><span style=\"color: #3366CC;\">'px'<\/span><span style=\"color: #339933;\">;<\/span><br \/>\ndocument.<span style=\"color: #660066;\">getElementById<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #3366CC;\">'adminlogin'<\/span><span style=\"color: #009900;\">&#41;<\/span>.<span style=\"color: #660066;\">style<\/span>.<span style=\"color: #660066;\">top<\/span><span style=\"color: #339933;\">=<\/span>elemOffset1<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #3366CC;\">'content'<\/span><span style=\"color: #009900;\">&#41;<\/span>.<span style=\"color: #660066;\">y<\/span><span style=\"color: #339933;\">+<\/span><span style=\"color: #3366CC;\">'px'<\/span><span style=\"color: #339933;\">;<\/span><br \/>\n<span style=\"color: #000066; font-weight: bold;\">var<\/span> x<span style=\"color: #339933;\">,<\/span>y<span style=\"color: #339933;\">;<\/span><br \/>\n<span style=\"color: #000066; font-weight: bold;\">function<\/span> elemOffset1<span style=\"color: #009900;\">&#40;<\/span>rRight<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #009900;\">&#123;<\/span><br \/>\n<span style=\"color: #000066; font-weight: bold;\">var<\/span> obj<span style=\"color: #339933;\">=<\/span> document.<span style=\"color: #660066;\">getElementById<\/span><span style=\"color: #009900;\">&#40;<\/span>rRight<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span><br \/>\n<span style=\"color: #000066; font-weight: bold;\">var<\/span> t <span style=\"color: #339933;\">=<\/span> obj.<span style=\"color: #660066;\">offsetTop<\/span><span style=\"color: #339933;\">;<\/span><br \/>\n<span style=\"color: #000066; font-weight: bold;\">var<\/span> l <span style=\"color: #339933;\">=<\/span> obj.<span style=\"color: #660066;\">offsetLeft<\/span><span style=\"color: #339933;\">;<\/span><br \/>\nwhile<span style=\"color: #009900;\">&#40;<\/span> obj<span style=\"color: #339933;\">=<\/span> obj.<span style=\"color: #660066;\">offsetParent<\/span><span style=\"color: #009900;\">&#41;<\/span> <span style=\"color: #009900;\">&#123;<\/span><br \/>\nt <span style=\"color: #339933;\">+=<\/span> obj.<span style=\"color: #660066;\">offsetTop<\/span><span style=\"color: #339933;\">;<\/span><br \/>\nl <span style=\"color: #339933;\">+=<\/span> obj.<span style=\"color: #660066;\">offsetLeft<\/span><span style=\"color: #339933;\">;<\/span><br \/>\n<span style=\"color: #009900;\">&#125;<\/span><br \/>\n<span style=\"color: #000066; font-weight: bold;\">return<\/span> <span style=\"color: #009900;\">&#123;<\/span><br \/>\nx <span style=\"color: #339933;\">:<\/span> l <span style=\"color: #339933;\">,<\/span><br \/>\ny <span style=\"color: #339933;\">:<\/span> t<br \/>\n<span style=\"color: #009900;\">&#125;<\/span><span style=\"color: #339933;\">;<\/span><br \/>\n<span style=\"color: #009900;\">&#125;<\/span><\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>\u5173\u4e8eoffsetTop\u3001clientTop\u3001scrollTop\u3001offsetTop\u7b49\u7684\u8be6\u7ec6\u89e3\u91ca\uff0c\u53ef\u4ee5\u67e5\u770b\uff1a<a title=\"JS\u4e2doffsetTop\u3001clientTop\u3001scrollTop\u3001offsetTop\u5404\u5c5e\u6027\u4ecb\u7ecd\uff08mark\uff09\" href=\"http:\/\/weitaoc.com\/?p=60\" target=\"_blank\">http:\/\/weitaoc.com\/?p=60<\/a><\/p>\n<p>\u8f6c\u8f7d\u8bf7\u6ce8\u660e\uff1a<a href=\"http:\/\/weitaoc.com\">\u8ff7\u8def\u7684\u8001\u9f20<\/a> &raquo; <a href=\"http:\/\/weitaoc.com\/?p=58\">\u5173\u4e8e\u6d6e\u52a8\u5c42\u7edd\u5bf9\u4f4d\u7f6e\u7684\u76f8\u5bf9\u5b9a\u4f4d<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>\u6709\u4e9b\u65f6\u5019\uff0c\u6211\u4eec\u9700\u8981\u4e00\u4e9b\u5c42\u60ac\u6d6e\u5728\u67d0\u4e00\u4e2a\u56fa\u5b9a\u7684div\u5c42\u7684\u76f8\u5bf9\u4fbf\u5b9c\u4f4d\u7f6e\uff0c\u6bd4\u5982\uff1a \u4e0b\u9762\u7684\u9ec4\u8272\u6ce8\u91ca\u6846\uff0c\u6211\u4eec\u5982\u4f55\u505a\u5462\uff1f \u6211\u4eec\u53ef\u4ee5\u4f7f\u7528offset*\u6765\u5b9e\u73b0\uff0c\u7b80\u5355\u63d0\u4f9b\u4e00\u4e0b\u4ee3\u7801\u5427\uff1a 12345678910111213141516document.getElementB [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[15],"class_list":["post-58","post","type-post","status-publish","format-standard","hentry","category-front-end","tag-js"],"views":3000,"_links":{"self":[{"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/posts\/58","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/weitaoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=58"}],"version-history":[{"count":0,"href":"http:\/\/weitaoc.com\/index.php?rest_route=\/wp\/v2\/posts\/58\/revisions"}],"wp:attachment":[{"href":"http:\/\/weitaoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/weitaoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/weitaoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}