{"id":27951,"date":"2024-11-24T12:34:00","date_gmt":"2024-11-24T04:34:00","guid":{"rendered":"https:\/\/fwq.ai\/blog\/27951\/"},"modified":"2024-11-24T12:34:00","modified_gmt":"2024-11-24T04:34:00","slug":"%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%e7%82%b9%e5%87%bb%e2%88%a8%e7%94%9f%e6%88%90%e7%ac%ac%e4%ba%8c%e5%bc%a0%e6%97%a5%e5%8e%86%e5%90%8e%ef%bc%8c%e7%ac%ac%e4%b8%80%e5%bc%a0%e8%a1%a8","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/27951\/","title":{"rendered":"\u5982\u4f55\u89e3\u51b3\u70b9\u51fb\u201c\u2228\u201d\u751f\u6210\u7b2c\u4e8c\u5f20\u65e5\u5386\u540e\uff0c\u7b2c\u4e00\u5f20\u8868\u683c\u88ab\u906e\u6321\u7684\u95ee\u9898\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173137034076604.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u89e3\u51b3\u70b9\u51fb\u201c\u2228\u201d\u751f\u6210\u7b2c\u4e8c\u5f20\u65e5\u5386\u540e\uff0c\u7b2c\u4e00\u5f20\u8868\u683c\u88ab\u906e\u6321\u7684\u95ee\u9898\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u89e3\u51b3\u70b9\u51fb\u201c\u2228\u201d\u751f\u6210\u7b2c\u4e8c\u5f20\u65e5\u5386\u540e\uff0c\u7b2c\u4e00\u5f20\u8868\u683c\u88ab\u906e\u6321\u7684\u95ee\u9898\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u8ba9\u8868\u683c\u6a2a\u5411<\/strong><\/p>\n<p><strong>\u95ee\u9898<\/strong><\/p>\n<p>\u5728\u70b9\u51fb\u4e0b\u6807\u201c\u2228\u201d\u540e\u751f\u6210\u7684\u7b2c\u4e8c\u5f20\u65e5\u5386\uff0c\u4f1a\u4f7f\u7b2c\u4e00\u5f20\u8868\u683c\u5411\u4e0a\u79fb\uff0c\u5bfc\u81f4\u4e0b\u6807\u201c\u2228\u201d\u548c\u201c\u786e\u5b9a\u201d\u906e\u6321\u6389\u4e00\u4e9b\u65e5\u671f\uff0c\u4e0d\u7f8e\u89c2\u3002\u89e3\u51b3\u65b9\u6cd5\u662f\u60f3\u8ba9\u70b9\u51fb\u201c\u2228\u201d\u540e\u65b0\u751f\u6210\u7684\u8868\u683c\u5f80\u53f3\u8fb9\u79fb\u52a8\uff0c\u4f46\u6ca1\u6709\u6548\u679c\u3002<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848<\/strong><\/p>\n<pre>&lt;button class='add_cla add_sty'&gt;\u2228&lt;\/button&gt;\n&lt;button class=\"button_cla button_sty\"&gt;\u786e\u5b9a&lt;\/button&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5728\u8868\u683c\u6807\u9898<\/p>\n<p> \u5185\u6dfb\u52a0\u4e24\u4e2abutton\u6309\u94ae\uff1a\u5206\u522b\u4e3a\u201c\u2228\u201d\u548c\u201c\u786e\u5b9a\u201d\u3002 <\/p>\n<pre>    \/\/\u83b7\u53d6\u2018\u2228\u2019\u7684\u70b9\u51fb\u6b21\u6570\n    var click_xia = 0; \/\/\u70b9\u51fb\u2018\u2228\u2019\u7684\u6b21\u6570\n    $('.add_cla').on('click', function () {\n        click_xia++;\n        if (click_xia == 1) {\n            draw(month_now + 2)\n        }\n        if (click_xia % 2 == 1) {\n            $('.table_cla').css('color', 'black');\n            $('.title_cla').css('background', '#ccc');\n\n            var td_ele2 = $('.td_event2')\/\/ \u83b7\u53d6class\n            console.log(td_ele2);\n            \/\/\u4e3atd\u2018\u70b9\u51fb\u2019\u6dfb\u52a0\u6837\u5f0f\n            td_ele2.click(function () {\n                $(this).addclass(\"dash_border\")\n                date_value = $(this).text() \/\/\u50a8\u5b58\u65e5\u671f\u7684\u503c\n            });\n\n            \/\/\u4e3a\u6bcf\u4e2atd2\u65e5\u671f\u6dfb\u52a0\u70b9\u51fb\u4e8b\u4ef6\n            for (var i = 0; i &lt; td_ele2.length; i++) {\n                \/\/ console.log(td_ele[i].innertext);\n                td_ele2[i].onclick = getnum(td_ele2[i], function (click_numm, date_numm) {\n                    if (click_numm % 2 == 0) {\n                        \/\/ console.log(\"\u70b9\u51fb\u4e86\u5076\u6570\u6b21\")\n                        $(date_numm).removeclass('dash_border');\n                        $(date_numm).css(\"color\", \"black\");\n                    } else {\n                        \/\/ console.log(\"\u70b9\u51fb\u4e86\u5947\u6570\u6b21\")\n                        $(date_numm).css(\"color\", \"pink\");\n                    }\n                });\n            }\n        }\n        $('.table_cla').fadetoggle(); \/\/\u6de1\u51fa\n    }\n    )<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5728\u83b7\u53d6\u70b9\u51fb\u6b21\u6570\u90e8\u5206\uff0c\u70b9\u51fb\u201c\u2228\u201d\u6b21\u6570\u4e3a\u5947\u6570\u6b21\u65f6\u751f\u6210\u8868\u683c\uff0c\u7136\u540e\u518d\u6839\u636e\u70b9\u51fb\u6b21\u6570\u8fdb\u884c\u5947\u5076\u5224\u65ad\uff1a\u5076\u6570\u6b21\u65f6\u79fb\u9664\u8fb9\u6846\u6837\u5f0f\u548c\u989c\u8272\uff1b\u5947\u6570\u6b21\u65f6\u6dfb\u52a0\u8fb9\u6846\u6837\u5f0f\u53ca\u989c\u8272\u3002<\/p>\n<pre>         \/\/\u4e3a\u6bcf\u4e2a\u6309\u94ae\u6dfb\u52a0\u70b9\u51fb\u4e8b\u4ef6\n    for (var i = 0; i &lt; $('.button_cla').length; i++) {\n        \/\/ console.log($('.button_cla').html);\n        $('.button_cla')[i].onclick = getNum($('.button_cla')[i], function (click_numm, date_numm) {\n            \/\/\u76d1\u6d4b\u5b58\u5728\u51e0\u4e2a\"dash_border\"\u6837\u5f0f\u7684td\n            for (var i = 1; i &lt;= $('.td_event').length; i++) {\n                console.log(i);\n                console.log($('.td_event')[i - 1]); \/\/\u522b\u95ee\uff0c\u95ee\u5c31\u662f\u80fd\u8dd1\u5c31\u884c\u3002\n                \/\/\u89e3\u51b3\u904d\u5386td\u7684id\n                if ($('#td_id' + i).hasClass('dash_border')) {\n                    console.log('\u65e5\u671f' + i + '\u5b58\u5728\u6837\u5f0fdash_border');\n                    $('#td_id' + i).removeClass('dash_border')\n                    $('#td_id' + i).css('color', 'black');\n                } else {\n                    console.log('\u65e5\u671f' + i + \"\u4e0d\u5b58\u5728\u6837\u5f0f\")\n                }\n            }\n            for (var i = 1; i &lt;= $('.td_event2').length; i++) {\n                console.log(i);\n                console.log($('.td_event2')[i - 1]); \/\/\u522b\u95ee\uff0c\u95ee\u5c31\u662f\u80fd\u8dd1\u5c31\u884c\u3002\n                \/\/\u89e3\u51b3\u904d\u5386td\u7684id\n                if ($('#td_id' +sign2+ i).hasClass('dash_border')) {\n                    console.log(sign2+'\u65e5\u671f' + i + '\u5b58\u5728\u6837\u5f0fdash_border');\n                    $('#td_id'  +sign2+ i).removeClass('dash_border')\n                    $('#td_id' +sign2 + i).css('color', 'black');\n                } else {\n                    console.log(sign2+'\u65e5\u671f' + i + \"\u4e0d\u5b58\u5728\u6837\u5f0f\")\n                }\n            }\n        });\n    }<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6dfb\u52a0\u53f3\u4fa7\u8868\u683c\u5bf9\u8c61(&#8216;.table_cla&#8217;)\u7684\u6de1\u51fa\u6de1\u5165\u6548\u679c\uff0c\u70b9\u51fb\u201c\u786e\u5b9a\u201d\u5c06\u6240\u6709dash_border\u548c\u989c\u8272\u79fb\u9664\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u89e3\u51b3\u70b9\u51fb\u201c\u2228\u201d\u751f\u6210\u7b2c\u4e8c\u5f20\u65e5\u5386\u540e\uff0c\u7b2c\u4e00\u5f20\u8868\u683c\u88ab\u906e\u6321\u7684\u95ee\u9898\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u8ba9\u8868\u683c\u6a2a\u5411 \u95ee\u9898 \u5728\u70b9\u51fb\u4e0b\u6807\u201c\u2228\u201d\u540e\u751f\u6210\u7684\u7b2c\u4e8c\u5f20\u65e5\u5386\uff0c\u4f1a\u4f7f\u7b2c\u4e00\u5f20\u8868\u683c\u5411\u4e0a\u79fb\uff0c\u5bfc\u81f4\u4e0b\u6807\u201c\u2228\u201d\u548c\u201c\u786e\u5b9a\u201d\u906e\u6321\u6389\u4e00\u4e9b\u65e5\u671f\uff0c\u4e0d\u7f8e\u89c2\u3002\u89e3\u51b3\u65b9\u6cd5\u662f\u60f3\u8ba9\u70b9\u51fb\u201c\u2228\u201d\u540e\u65b0\u751f\u6210\u7684\u8868\u683c\u5f80\u53f3\u8fb9\u79fb\u52a8\uff0c\u4f46\u6ca1\u6709\u6548\u679c\u3002 \u89e3\u51b3\u65b9\u6848 &lt;button class=&#8217;add_cla add_sty&#8217;&gt;\u2228&lt;\/button&gt; &lt;button class=&#8221;button_cla button_sty&#8221;&gt;\u786e\u5b9a&lt;\/button&gt; \u767b\u5f55\u540e\u590d\u5236 \u5728\u8868\u683c\u6807\u9898 \u5185\u6dfb\u52a0\u4e24\u4e2abutton\u6309\u94ae\uff1a\u5206\u522b\u4e3a\u201c\u2228\u201d\u548c\u201c\u786e\u5b9a\u201d\u3002 \/\/\u83b7\u53d6\u2018\u2228\u2019\u7684\u70b9\u51fb\u6b21\u6570 var click_xia = 0; \/\/\u70b9\u51fb\u2018\u2228\u2019\u7684\u6b21\u6570 $(&#8216;.add_cla&#8217;).on(&#8216;click&#8217;, function () { click_xia++; if (click_xia == 1) { draw(month_now + 2) } if (click_xia % 2 == 1) { $(&#8216;.table_cla&#8217;).css(&#8216;color&#8217;, &#8216;black&#8217;); $(&#8216;.title_cla&#8217;).css(&#8216;background&#8217;, &#8216;#ccc&#8217;); var td_ele2 = $(&#8216;.td_event2&#8217;)\/\/ \u83b7\u53d6class console.log(td_ele2); \/\/\u4e3atd\u2018\u70b9\u51fb\u2019\u6dfb\u52a0\u6837\u5f0f td_ele2.click(function () { $(this).addclass(&#8220;dash_border&#8221;) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-27951","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27951","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=27951"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27951\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=27951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=27951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=27951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}