{"id":776,"date":"2017-03-07T22:40:38","date_gmt":"2017-03-07T14:40:38","guid":{"rendered":"http:\/\/www.qdabc.cn\/?p=776"},"modified":"2017-03-07T22:34:06","modified_gmt":"2017-03-07T14:34:06","slug":"js%e6%a8%a1%e4%bb%bfqq%e4%b8%8b%e6%8b%89%e5%88%97%e8%a1%a8","status":"publish","type":"post","link":"http:\/\/www.qdabc.cn\/?p=776","title":{"rendered":"js\u6a21\u4effqq\u4e0b\u62c9\u5217\u8868"},"content":{"rendered":"<pre class=\"brush:html;toolbar:false\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n    &lt;head&gt;\r\n        &lt;meta charset=\"UTF-8\"&gt;\r\n        &lt;title&gt;\u539f\u751fjs\u6a21\u62dfqq\u4e0b\u62c9\u5217\u8868 &lt;\/title&gt;\r\n        &lt;style&gt;\r\n            *{\r\n                margin: 0;\r\n                padding: 0;\r\n            }\r\n            li{\r\n                list-style: none;\r\n            }\r\n            #list{\r\n                width: 240px;\r\n                border: 1px solid #666;\r\n                margin: 20px auto;\r\n            }\r\n            #list .lis{\r\n            }\r\n            #list h2{\r\n                height: 30px;\r\n                line-height: 30px;\r\n                overflow: hidden;\r\n                background:red;\r\n                color: #f1f1f1;\r\n                cursor:pointer;\r\n            }\r\n            #list h2.active{\r\n                background: pink;\r\n                height: 30px;\r\n                line-height: 30px;\r\n                overflow: hidden;\r\n                color: #666;\r\n            }\r\n            #list h2.active:before{\r\n                display: block;\r\n                width: 0;\r\n                height: 0;\r\n                border-left: 8px solid transparent;\r\n                border-top: 12px solid #666;\r\n                border-right:8px solid transparent;\r\n                border-bottom:2px solid transparent;\r\n                margin-right: 4px;\r\n                content: '';\r\n                float: left;\r\n                margin-top: 10px;\r\n            }\r\n            #list h2:before{\r\n                display: block;\r\n                width: 0;\r\n                height: 0;\r\n                border-left: 12px solid #f1f1f1;\r\n                border-right: 6px solid transparent;\r\n                border-bottom: 9px solid transparent;\r\n                border-top:9px solid transparent;\r\n                content: '';\r\n                float: left;\r\n                margin-top: 10px;\r\n            }\r\n            #list .list ul{\r\n                display: none;\r\n            }\r\n            #list .list ul li{\r\n                line-height: 24px;\r\n                border-bottom: 1px solid #666;\r\n                text-indent: 15px;\r\n            }\r\n            #list .list ul li.hover{\r\n                background: blue;\r\n                color: #F8F8F8;\r\n            }\r\n            #list .list ul li:first-of-type{\r\n                border-top: 1px solid #ccc;\r\n            }\r\n            #list .list:last-of-type ul li:last-of-type{\r\n                border-bottom:none;\r\n            }\r\n        &lt;\/style&gt;\r\n        &lt;script&gt;\r\n            window.onload=function(){\r\n                var oUl=document.getElementById('list');\r\n                var aH2=oUl.getElementsByTagName('h2');\r\n                var aUl=oUl.getElementsByTagName('ul');\r\n                var h2Len=aH2.length;\r\n                var aLi=null;\r\n                var arrLi=[];\r\n                var aUlLen=aUl.length;\r\n                for(var i=0;i&lt;h2Len;i++){\r\n                    aH2[i].index=i;\r\n                    aH2[i].onclick=function(){\r\n                        if(this.className=='')\r\n                        {\r\n                            aUl[this.index].style.display='block';\r\n                            this.className='active';\r\n                        }\r\n                        else{\r\n                            aUl[this.index].style.display='none';\r\n                            this.className='';\r\n                        }\r\n                    }\r\n                }\r\n                for(var i=0;i&lt;aUlLen;i++){\r\n                    aLi=aUl[i].getElementsByTagName('li');\r\n                    for(var j=0;j&lt;aLi.length;j++){\r\n                        arrLi.push(aLi[j]);\r\n                    }\r\n                }\r\n                for(var i=0;i&lt;arrLi.length;i++){\r\n                    arrLi[i].onclick=function(){\r\n                        for(var i=0;i&lt;arrLi.length;i++){\r\n                            arrLi[i].className='';\r\n                        }\r\n                        this.className='hover';\r\n                    }\r\n                }\r\n            }\r\n        &lt;\/script&gt;\r\n    &lt;\/head&gt;\r\n    &lt;body&gt;\r\n        &lt;ul id=\"list\"&gt;\r\n            &lt;li class=\"list\"&gt;\r\n                &lt;h2&gt;\u5927\u5b66\u540c\u5b66&lt;\/h2&gt;\r\n                &lt;ul&gt;\r\n                    &lt;li&gt;\u5f20\u4e09&lt;\/li&gt;\r\n                    &lt;li&gt;\u5f20\u4e09&lt;\/li&gt;\r\n                    &lt;li&gt;\u5f20\u4e09&lt;\/li&gt;\r\n                    &lt;li&gt;\u5f20\u4e09&lt;\/li&gt;\r\n                &lt;\/ul&gt;\r\n            &lt;\/li&gt;\r\n            &lt;li class=\"list\"&gt;\r\n                &lt;h2&gt;\u9ad8\u4e2d\u540c\u5b66&lt;\/h2&gt;\r\n                &lt;ul&gt;\r\n                    &lt;li&gt;\u674e\u56db&lt;\/li&gt;\r\n                    &lt;li&gt;\u674e\u56db&lt;\/li&gt;\r\n                    &lt;li&gt;\u674e\u56db&lt;\/li&gt;\r\n                    &lt;li&gt;\u674e\u56db&lt;\/li&gt;\r\n                &lt;\/ul&gt;\r\n            &lt;\/li&gt;\r\n            &lt;li class=\"list\"&gt;\r\n                &lt;h2&gt;\u521d\u4e2d\u540c\u5b66&lt;\/h2&gt;\r\n                &lt;ul&gt;\r\n                    &lt;li&gt;\u738b\u4e94&lt;\/li&gt;\r\n                    &lt;li&gt;\u738b\u4e94&lt;\/li&gt;\r\n                    &lt;li&gt;\u738b\u4e94&lt;\/li&gt;\r\n                    &lt;li&gt;\u738b\u4e94&lt;\/li&gt;\r\n                &lt;\/ul&gt;\r\n            &lt;\/li&gt;\r\n        &lt;\/ul&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p class=\"post-copyright\">\u6b22\u8fce\u5206\u4eab\u672c\u6587\uff0c\u8f6c\u8f7d\u8bf7\u4fdd\u7559\u51fa\u5904\uff1a<a href=\"http:\/\/www.qdabc.cn\">\u524d\u7aefABC<\/a> &raquo; <a href=\"http:\/\/www.qdabc.cn\/?p=776\">js\u6a21\u4effqq\u4e0b\u62c9\u5217\u8868<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset=&#8221;UTF-8&#8243;&gt; &lt;title&gt;\u539f\u751fjs\u6a21\u62dfqq\u4e0b\u62c9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":322,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[9],"_links":{"self":[{"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=\/wp\/v2\/posts\/776"}],"collection":[{"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=776"}],"version-history":[{"count":1,"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=\/wp\/v2\/posts\/776\/revisions"}],"predecessor-version":[{"id":777,"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=\/wp\/v2\/posts\/776\/revisions\/777"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=\/wp\/v2\/media\/322"}],"wp:attachment":[{"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=776"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=776"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}