{"id":167098,"date":"2020-10-08T02:34:22","date_gmt":"2020-10-07T18:34:22","guid":{"rendered":"http:\/\/4563.org\/?p=167098"},"modified":"2020-10-08T02:34:22","modified_gmt":"2020-10-07T18:34:22","slug":"%e5%85%b3%e4%ba%8e-js-%e8%84%9a%e6%9c%ac%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=167098","title":{"rendered":"\u5173\u4e8e JS \u811a\u672c\u7684\u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5173\u4e8e JS \u811a\u672c\u7684\u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : F19 <\/span>  <span><i><\/i> 3<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6211\u6ca1\u5b66\u8fc7 js\uff0c\u4f46\u662f\u6211\u60f3\u5199\u4e00\u4e2a\u6cb9\u7334\u811a\u672c\u3002 \u529f\u80fd\u662f\u5728\u8bba\u575b\u8fd9\u4e9b\u7f51\u7ad9\u653e\u4e00\u4e2a\u5f88\u591a\u56de\u590d\u8bed\u7684\u9009\u9879\uff0c\u9009\u4e2d\u54ea\u4e2a\u56de\u590d\u8bed\uff08\u6bd4\u5982\uff0c\u8c22\u8c22\u4e3b\u3002\u4f46\u662f\u53c8\u4e0d\u662f\u53ea\u6709\u8fd9\u4e00\u53e5\uff09\u5c31\u4f1a\u586b\u597d\u5728\u56de\u590d\u6846\uff0c\u7136\u540e\u70b9\u51fb\u53d1\u5e03\u5c31\u53ef\u4ee5\u4e86\u3002 \u8bf7\u95ee\u4e00\u4e0b\uff0c\u5199\u8fd9\u6837\u7684\u811a\u672c\u96be\u5417\u3002\u8c22\u8c22\u5927\u5bb6<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>6<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3692360\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yiXu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u611f\u89c9\u4e0d\u662f\u7279\u522b\u96be\uff0c\u5339\u914d\u7f51\u7ad9\uff0c\u6dfb\u52a0 dom\uff0cdom \u6309\u94ae\u6dfb\u52a0\u89e6\u53d1\uff0c\u89e6\u53d1\u540e\u6839\u636e id \u7ed9\u8f93\u5165\u6846\u5199\u5165\u5bf9\u5e94\u5185\u5bb9\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3692361\" 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>                                                             \u4e0d\u96be<\/p>\n<p>1. \u627e\u5230\u56de\u590d\u6b63\u6587\u7684 class<br \/>2. \u7ed1\u5b9a\u4e8b\u4ef6\uff0c\u4f8b\u5982\u70b9\u51fb\u65f6\u5f39\u51fa\u5f39\u7a97\u662f\u5426\u5f15\u7528\u8be5\u56de\u590d<br \/>3. \u5982\u679c\u662f\u627e\u5230\u56de\u590d\u7684\u8f93\u5165\u6846\u628a\u5185\u5bb9\u590d\u5236\u8fdb\u53bb                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3692362\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : imdong <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5207\u5165\u70b9\u633a\u597d\uff0c\u4ece\u65b0\u624b\u5165\u95e8\u5230\u4e2d\u9636\u5f00\u53d1\uff0c\u80fd\u4e00\u6b65\u6b65\u4f18\u5316\u4e0a\u53bb\uff0c\u65b0\u624b\u505a\u4e0d\u662f\u5f88\u96be(\u5982\u679c\u6709\u5176\u4ed6\u7f16\u7a0b\u8bed\u8a00\u57fa\u7840\u7684\u8bdd)\uff0c\u4e0d\u7136\u53ef\u80fd\u9700\u8981\u4e86\u89e3\u7684\u4e1c\u897f\u8fd8\u662f\u633a\u591a\u7684\uff0c\u4e0d\u8981\u7528 jQuery \u4e4b\u7c7b\u7684\u4e1c\u897f\uff0c\u53ef\u4ee5\u76f4\u63a5\u641e\u539f\u751f\u3002<\/p>\n<p>\u4e2a\u4eba\u8fd8\u662f\u633a\u63a8\u8350\u8fd9\u6837\u7684\u901a\u8fc7\u6709\u76ee\u7684\u5b9e\u8df5\u7684\u5b66\u4e60\u65b9\u6cd5\uff0c\u800c\u4e14\u96be\u5ea6\u4e0d\u662f\u5f88\u9ad8\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3692363\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yamedie <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             (() =&gt; {<br \/> let list = [&#8216;\u5b66\u4e60\u4e86&#8217;, &#8216;\u8c22\u8c22\u4e3b&#8217;, &#8216;\u7d2b\u85af\u5e03\u4e01&#8217;];<br \/> let c = t =&gt; document.createElement(t);<br \/> let s = t =&gt; document.querySelector(t);<br \/> let ta = s(&#8216;textarea&#8217;);<br \/> if(!ta) return;<\/p>\n<p> let box = c(&#8216;div&#8217;);<br \/> box.style.position = &#8216;absolute&#8217;;<br \/> box.style.display = &#8216;none&#8217;;<br \/> box.style.background = &#8216;rgba(230, 230, 230, 0.4)&#8217;;<br \/> box.style.borderRadius = &#8216;0.2em&#8217;;<\/p>\n<p> for (let i of list) {<br \/> let p = c(&#8216;p&#8217;);<br \/> p.innerText = i;<br \/> p.style.color = &#8216;#333&#8217;;<br \/> p.style.margin = &#8216;0.5em 1em&#8217;;<br \/> p.style.cursor = &#8216;pointer&#8217;;<br \/> p.onclick = () =&gt; {<br \/> ta.value = ta.value + i;<br \/> box.style.display = &#8216;none&#8217;;<br \/> };<br \/> box.appendChild(p);<br \/> }<br \/> document.body.appendChild(box);<\/p>\n<p> ta.oncontextmenu = e =&gt; {<br \/> e.preventDefault();<br \/> console.log(e);<br \/> let { pageX, pageY } = e;<br \/> box.style.top = pageY + &#8216;px&#8217;;<br \/> box.style.left = pageX + &#8216;px&#8217;;<br \/> box.style.display = &#8216;block&#8217;;<br \/> }<br \/>})();<\/p>\n<p>\/\/ \u6839\u636e\u4e3b\u7684\u63cf\u8ff0\u5199\u4e86\u4e00\u4e2a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3692364\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yamedie <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \/\/ \u53f3\u952e\u70b9\u51fb\u6587\u672c\u6846\u7684\u65f6\u5019\u53ef\u4ee5\u89e6\u53d1                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3692365\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : F19 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @yamedie \u5927\u8001\u5389\u5bb3                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5173\u4e8e JS \u811a\u672c\u7684\u95ee\u9898 \u8cc7\u6df1\u5927\u4f6c &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\/167098"}],"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=167098"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/167098\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=167098"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=167098"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=167098"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}