{"id":724,"date":"2017-04-30T15:16:54","date_gmt":"2017-04-30T07:16:54","guid":{"rendered":"http:\/\/www.rain1024.com\/?p=724"},"modified":"2023-08-07T20:57:28","modified_gmt":"2023-08-07T12:57:28","slug":"js-article76","status":"publish","type":"post","link":"http:\/\/rain1024.com\/index.php\/2017\/04\/30\/js-article76\/","title":{"rendered":"JS\u5b9e\u73b0\u591a\u4e2aDiv\u7684\u5207\u6362\u663e\u793a"},"content":{"rendered":"<p>JS\u5b9e\u73b0\u591a\u4e2aDiv\u7684\u5207\u6362\u663e\u793a<\/p>\n<h3>\u7ecf\u5e38\u4f1a\u5728\u7f51\u9875\u4e2d\u770b\u5230\u6709\u4e2a\u4fbf\u7b7e\u91cc\u6709\u591a\u4e2a\u6309\u94ae\uff0c\u6bcf\u4e2a\u6309\u94ae\u90fd\u80fd\u663e\u793a\u4e0d\u540c\u7684\u5185\u5bb9\uff0c\u5176\u5b9e\u8fd9\u5c31\u662f\u591a\u4e2aDiv\u653e\u5728\u4e00\u8d77\u7136\u540e\u8f6e\u6d41\u663e\u793a\uff0c\u4e0b\u9762\u662f\u4ee3\u7801\uff0c\u76f4\u63a5\u67e5\u770b\u4ee3\u7801\u6548\u679c\u7684\uff0c\u53ef\u4ee5\u6233\u8fd9\u91cc<a href=\"http:\/\/www.rain1024.com\/page\/js76.html\">www.rain1024.com-js76<\/a><\/h3>\n<h3>\u4e0b\u9762\u662f\u4ee3\u7801<\/h3>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;title&gt;&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;script&gt;\n    \/\/    \u8bbe\u7f6e\u6bcf\u79d2\u5237\u65b0\u4e00\u6b21\n\/\/    function myshuaxing() {\n\/\/        window.location.reload();\n\/\/    }\n\/\/    setTimeout('myshuaxing()',2000);\n&lt;\/script&gt;\n&lt;style&gt;\n    .all{\n        width: 306px;\n        height: 300px;\n        background-color: #616378;\n        border-width: 2px;\n        border-style: solid;\n        border-color: #8C8EA3;\n    }\n    .menu1{\n        width: 100px;\n        height: 25px;\n        background-color: #CCCCD4;\n        padding-top: 10px;\n        text-align: center;\n        margin-right: 1px;\n        float: left;\n    }\n    .menu2{\n        width: 100px;\n        height: 25px;\n        background-color: #FFFFFF;\n        padding-top: 10px;\n        text-align: center;\n        margin-right: 2px;\n        margin-left: 2px;\n        float: left;\n    }\n    .menu3{\n        width: 100px;\n        height: 25px;\n        background-color: #FFFFFF;\n        padding-top: 10px;\n        text-align: center;\n        margin-left: 1px;\n        float: left;\n    }\n    .content1{\n        width: 306px;\n        height: 200px;\n        padding-top: 100px;\n        text-align: center;\n        background-color: #CCCCD4;\n    }\n    .content2{\n        width: 306px;\n        height: 200px;\n        padding-top: 100px;\n        text-align: center;\n        background-color: #CCCCD4;\n        display: none;\n    }\n    .content3{\n        width: 306px;\n        height: 200px;\n        padding-top: 100px;\n        text-align: center;\n        background-color: #CCCCD4;\n        display: none;\n    }\n&lt;\/style&gt;\n&lt;script&gt;\n    function display(value){\n        if(value==1){\n            document.getElementById('menu1').style.backgroundColor='#CCCCD4';\n            document.getElementById('menu2').style.backgroundColor='#FFFFFF';\n            document.getElementById('menu3').style.backgroundColor='#FFFFFF';\n            document.getElementById('content1').style.display='block';\n            document.getElementById('content2').style.display='none';\n            document.getElementById('content3').style.display='none';\n        }else if(value==2){\n            document.getElementById('menu1').style.backgroundColor='#FFFFFF';\n            document.getElementById('menu2').style.backgroundColor='#CCCCD4';\n            document.getElementById('menu3').style.backgroundColor='#FFFFFF';\n            document.getElementById('content1').style.display='none';\n            document.getElementById('content2').style.display='block';\n            document.getElementById('content3').style.display='none';\n        }else if(value==3){\n            document.getElementById('menu1').style.backgroundColor='#FFFFFF';\n            document.getElementById('menu2').style.backgroundColor='#FFFFFF';\n            document.getElementById('menu3').style.backgroundColor='#CCCCD4';\n            document.getElementById('content1').style.display='none';\n            document.getElementById('content2').style.display='none';\n            document.getElementById('content3').style.display='block';\n        }\n    }\n&lt;\/script&gt;\n&lt;body&gt;\n&lt;div class=\"all\"&gt;\n    &lt;div id=\"menu1\" class=\"menu1\" onclick=\"display(1)\"&gt;tab1&lt;\/div&gt;\n    &lt;div id=\"menu2\" class=\"menu2\" onclick=\"display(2)\"&gt;tab2&lt;\/div&gt;\n    &lt;div id=\"menu3\" class=\"menu3\" onclick=\"display(3)\"&gt;tab3&lt;\/div&gt;\n    &lt;div id=\"content1\" class=\"content1\"&gt;&lt;h1&gt;123&lt;\/h1&gt;&lt;\/div&gt;\n    &lt;div id=\"content2\" class=\"content2\"&gt;&lt;h1&gt;456&lt;\/h1&gt;&lt;\/div&gt;\n    &lt;div id=\"content3\" class=\"content3\"&gt;&lt;h1&gt;789&lt;\/h1&gt;&lt;\/div&gt;\n&lt;\/div&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>JS\u5b9e\u73b0\u591a\u4e2aDiv\u7684\u5207\u6362\u663e\u793a \u7ecf\u5e38\u4f1a\u5728\u7f51\u9875\u4e2d\u770b\u5230\u6709\u4e2a\u4fbf\u7b7e\u91cc\u6709\u591a\u4e2a\u6309\u94ae\uff0c\u6bcf\u4e2a\u6309\u94ae\u90fd\u80fd\u663e\u793a\u4e0d\u540c\u7684\u5185\u5bb9\uff0c\u5176\u5b9e\u8fd9\u5c31\u662f\u591a\u2026 <span class=\"read-more\"><a href=\"http:\/\/rain1024.com\/index.php\/2017\/04\/30\/js-article76\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":420,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30,32],"tags":[40,45,47],"class_list":["post-724","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html","category-javascript","tag-css","tag-html","tag-javasciprt"],"_links":{"self":[{"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/posts\/724","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/comments?post=724"}],"version-history":[{"count":1,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/posts\/724\/revisions"}],"predecessor-version":[{"id":1457,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/posts\/724\/revisions\/1457"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/media\/420"}],"wp:attachment":[{"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/media?parent=724"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/categories?post=724"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/tags?post=724"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}