{"id":54512,"date":"2020-04-09T09:23:41","date_gmt":"2020-04-09T01:23:41","guid":{"rendered":"http:\/\/4563.org\/?p=54512"},"modified":"2020-04-09T09:23:41","modified_gmt":"2020-04-09T01:23:41","slug":"%e4%b8%80%e6%ae%b5js%e4%bb%a3%e7%a0%81%ef%bc%8c%e4%b8%ba%e4%bb%80%e4%b9%88%e5%9c%a8%e6%9c%ac%e5%9c%b0%e6%b5%8b%e8%af%95%e6%b2%a1%e9%97%ae%e9%a2%98%ef%bc%8c%e4%bd%86%e6%94%be%e5%88%b0%e6%9c%8d%e5%8a%a1","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=54512","title":{"rendered":"\u4e00\u6bb5JS\u4ee3\u7801\uff0c\u4e3a\u4ec0\u4e48\u5728\u672c\u5730\u6d4b\u8bd5\u6ca1\u95ee\u9898\uff0c\u4f46\u653e\u5230\u670d\u52a1\u5668\u4e0a\u5c31&#8230;"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>blink<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>\u4e00\u6bb5JS\u4ee3\u7801\uff0c\u4e3a\u4ec0\u4e48\u5728\u672c\u5730\u6d4b\u8bd5\u6ca1\u95ee\u9898\uff0c\u4f46\u653e\u5230\u670d\u52a1\u5668\u4e0a\u5c31&#8230;<\/h3>\n<p>  \t\t\u4e00\u6bb5JS\u4ee3\u7801\uff0c\u4e3a\u4ec0\u4e48\u5728\u672c\u5730\u6d4b\u8bd5\u6ca1\u95ee\u9898\uff0c\u4f46\u653e\u5230\u670d\u52a1\u5668\u4e0a\u5c31\u6709\u95ee\u9898\u554a<\/p>\n<p>  \u2026\u2026<\/p>\n<p>  jQuery(document).ready(function($){&nbsp; &nbsp;<br \/>  $.fn.smartFloat = function() {&nbsp; &nbsp;<br \/>  &nbsp; &nbsp; var position = function(element) {&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;var top = element.position().top, pos = element.css(&quot;position&quot;);&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;$(window).scroll(function() {&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;var scrolls = $(this).scrollTop();&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if (scrolls &gt; top) {&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; if (window.XMLHttpRequest) {&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;element.css({&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;position: &quot;fixed&quot;,&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;top: 100,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;\/\/ width: &quot;100%&quot;,<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&#8216;margin-right&#8217;:15<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;});&nbsp; &nbsp;&nbsp; &nbsp; <br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; } else {&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;element.css({&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;top: scrolls <br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;});&nbsp; &nbsp;&nbsp; &nbsp; <br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; }&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}else {&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; element.css({&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;position: &quot;absolute&quot;,&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;top: top,&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;width: \u2018inherit\u2019<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; });&nbsp; &nbsp;&nbsp; &nbsp; <br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;});&nbsp; &nbsp;<br \/>  &nbsp; &nbsp; };&nbsp; &nbsp;<br \/>  &nbsp; &nbsp; return $(this).each(function() {&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;position($(this));&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; <br \/>  &nbsp; &nbsp; });&nbsp; &nbsp;<br \/>  };&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;<br \/>  \/\/\u7ed1\u5b9a,\u5c06\u5f15\u53f7\u4e2d\u7684\u5185\u5bb9\u66ff\u6362\u6210\u4f60\u60f3\u8981\u4e0b\u62c9\u7684\u6a21\u5757\u7684ID\u6216\u8005CLASS\u540d\u5b57,\u5982&quot;#ABC&quot;,&quot;.ABC&quot;&nbsp; &nbsp;<br \/>  $(&quot;.widget-toc&quot;).smartFloat();&nbsp; &nbsp;<br \/>  &nbsp; &nbsp;<br \/>  });<\/p>\n<p>  \u5c31\u662f\u60f3\u8ba9\u4fa7\u8fb9\u7684\u4e1c\u897f\u8ddf\u968f\uff0c\u5728\u628a position: &quot;fixed&quot;,\u4e4b\u540e\uff0c\u5728\u672c\u5730\u5bbd\u5ea6\u662f\u6b63\u5e38\u7684\uff0c\u4f46\u653e\u5230\u7ebf\u4e0a\u5c31\u4e0d\u884c\u2026\u2026\u54ea\u91cc\u7684\u95ee\u9898\u554a\uff1f\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u4e00\u4e2a\u4e0d\u77e5\u540d\u7f51\u53cb<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u56e0\u4e3a\u672c\u5730\u548c\u7f51\u7edc\u6709\u70b9\u4e0d\u4e00\u6837\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>msoayu56<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6ca1\u7528\u8fc7jquery\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>Mr.<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\twidth: \u2018inherit\u2019 \u8fd9\u884c\u7684\u5355\u5f15\u53f7\u597d\u50cf\u6709\u95ee\u9898\u554a\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>blink<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\tMr. \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-4-7 22:48<br \/>  width: \u2018inherit\u2019 \u8fd9\u884c\u7684\u5355\u5f15\u53f7\u597d\u50cf\u6709\u95ee\u9898\u554a<\/p>\n<p> \u8fd9\u4e2a\u6211\u8bd5\u4e86\u5355\u5f15\u53f7\u53cc\u5f15\u53f7\u6ca1\u5f15\u53f7\uff0c\u90fd\u4e0d\u884c\u3002<\/p>\n<p>  \u672c\u5730\u4e0a\u662f\u6ca1\u5f15\u53f7\u7684\uff0c\u7ebf\u4e0a\u600e\u4e48\u7740\u90fd\u4e0d\u884c\uff0c\u771f\u7684\u5f88\u8ff7\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>Mr.<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\tblink \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-4-7 22:54<br \/>  \u8fd9\u4e2a\u6211\u8bd5\u4e86\u5355\u5f15\u53f7\u53cc\u5f15\u53f7\u6ca1\u5f15\u53f7\uff0c\u90fd\u4e0d\u884c\u3002<\/p>\n<p>  \u672c\u5730\u4e0a\u662f\u6ca1\u5f15\u53f7\u7684\uff0c\u7ebf\u4e0a\u600e\u4e48\u7740\u90fd\u4e0d\u884c\uff0c\u771f\u7684\u5f88\u8ff7 &#8230;<\/p>\n<p> \u770b\u63a7\u5236\u53f0\u6709\u6ca1\u6709\u62a5\u9519\uff0c\u6ca1\u62a5\u9519\u7684\u8bdd\u770b\u90a3\u51e0\u4e2a if \u6761\u4ef6\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>adminii<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\twindow.XMLHttpRequest \u7528\u8fd9\u4e2a\u5224\u65ad\u662f\u5426\u4e3aIE?\u679c\u771f\u5404\u79cd\u5947**\u6280\u5de7\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>blink<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\tMr. \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-4-7 22:56<br \/>  \u770b\u63a7\u5236\u53f0\u6709\u6ca1\u6709\u62a5\u9519\uff0c\u6ca1\u62a5\u9519\u7684\u8bdd\u770b\u90a3\u51e0\u4e2a if \u6761\u4ef6<\/p>\n<p> \u63a7\u5236\u53f0\u6ca1\u6709\u9519\u8bef\uff0c\u5b9e\u5728\u4e0d\u77e5\u9053\u4e86\uff0c\u5f97\u91cd\u65b0\u5199\u4e00\u4e2a\u4e86\uff0c\u4e0d\u9760position fixed\u4e86\uff0c\u8fd9\u73a9\u610f\u513f\u597d\u70e6\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>Mr.<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\tblink \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-4-8 00:01<br \/>  \u63a7\u5236\u53f0\u6ca1\u6709\u9519\u8bef\uff0c\u5b9e\u5728\u4e0d\u77e5\u9053\u4e86\uff0c\u5f97\u91cd\u65b0\u5199\u4e00\u4e2a\u4e86\uff0c\u4e0d\u9760position fixed\u4e86\uff0c\u8fd9\u73a9\u610f\u513f\u597d\u70e6 &#8230;<\/p>\n<p> \u4f60\u4e3b\u8d34\u91cc\u7684\u90a3\u6bb5\u4ee3\u7801\uff0c\u6211\u7c98\u8d34\u5230\u63a7\u5236\u53f0\u5c31\u51fa\u9519\u4e86\uff0c\u8bed\u6cd5\u9519\u8bef\uff0c\u5355\u5f15\u53f7\u80af\u5b9a\u5f97\u6539\u3002<br \/>  \u81f3\u4e8e\u4f60\u8bf4\u7684\u672c\u5730\u65e0\u5f15\u53f7\u90fd\u6b63\u5e38\uff0c\u8fd9\u6211\u80af\u5b9a\u4e0d\u4fe1\uff0c\u9664\u975e\u6709 inherit \u8fd9\u4e2a\u53d8\u91cf\u3002\u3002\u3002<br \/>  \u4f60\u5148\u786e\u5b9a\u4e00\u4e0b\u7ebf\u4e0a\u7684\u4ee3\u7801\u6709\u6ca1\u6709\u88ab\u6b63\u786e\u52a0\u8f7d\u5427\uff0c\u7f13\u5b58\u5565\u7684\u3002\u3002\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>why?<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5927\u5c0f\u5199\uff0c\u4e2d\u82f1\u6587\uff0c\u7279\u6b8a\u5b57\u7b26\uff0c\u8def\u5f84\uff0c\u4e00\u822c\u5c31\u8fd9\u51e0\u79cd\u4e86\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>blink \u5927\u4f6c\u6709\u8bdd\u8bf4 : \u4e00\u6bb5J&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\/54512"}],"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=54512"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/54512\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=54512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=54512"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=54512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}