﻿{"id":1193,"date":"2010-08-01T09:41:47","date_gmt":"2010-08-01T01:41:47","guid":{"rendered":"http:\/\/blog.jixin.ntxz.net\/?p=1193"},"modified":"2010-08-01T09:41:47","modified_gmt":"2010-08-01T01:41:47","slug":"%e7%94%a8jquery%e5%86%99%e4%b8%80%e4%b8%aa%e7%ae%80%e5%8d%95%e7%9a%84%e8%8f%9c%e5%8d%95%e4%bc%b8%e7%bc%a9%e6%95%88%e6%9e%9c-2","status":"publish","type":"post","link":"http:\/\/www.ntxz.net\/?p=1193","title":{"rendered":"\u7528jquery\u5199\u4e00\u4e2a\u7b80\u5355\u7684\u83dc\u5355\u4f38\u7f29\u6548\u679c"},"content":{"rendered":"<p>\u5148\u770b\u4e0b\u6548\u679c\u56fe\u5427\uff01\u5176\u5b9e\u662f\u4e00\u4e2a\u5f88\u7b80\u5355\u7684\u4e1c\u897f\u3002\u53ea\u662f\u5bf9\u4ee5\u524d\u7684\u77e5\u8bc6\u590d\u4e60\u4e0b\u3002\u8fd9\u91cc\u5c31\u4e0d\u505a\u8be6\u7ec6\u8bf4\u660e\u4e86\uff0c\u61c2\u5f97jQuery\u7684\u9009\u62e9\u5668\u548c\u6548\u679c\u5c31\u884c\u4e86\u3002<br \/>\n<a href=\"http:\/\/blog.jixin.ntxz.net\/wp-content\/uploads\/2010\/08\/jqueryshowsidebar.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.jixin.ntxz.net\/wp-content\/uploads\/2010\/08\/jqueryshowsidebar-300x214.png\" alt=\"\" title=\"jqueryshowsidebar\" width=\"300\" height=\"214\" class=\"alignnone size-medium wp-image-1194\" srcset=\"http:\/\/www.ntxz.net\/wp-content\/uploads\/2010\/08\/jqueryshowsidebar-300x214.png 300w, http:\/\/www.ntxz.net\/wp-content\/uploads\/2010\/08\/jqueryshowsidebar.png 345w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\njQuery\u7684\u4ee3\u7801\u5982\u4e0b\uff1a<br \/>\n<coolcode><br \/>\njQuery(document).ready(function(){<br \/>\n    jQuery(&#8220;dd:not(:first)&#8221;).hide();<br \/>\n        jQuery(&#8220;dt a&#8221;).click(function(){<br \/>\n        jQuery(&#8220;dd:visible&#8221;).slideUp(&#8220;slow&#8221;);<br \/>\n        jQuery(this).parent().next().slideDown(&#8220;slow&#8221;);<br \/>\n        return false;<br \/>\n    });<br \/>\n});<br \/>\n<\/coolcode><br \/>\n\u5728\u4e0a\u9762\u6211\u4eec\u7528\u5230\u4e86jQuery\u7684\u201d:not\u201d\uff0c\u201d:first\u201d\uff0c\u201d:visible\u201d\uff0c\u201d.parent(Selector) \u201c\uff0c\u201d.next(Selector) \u201c\u8fd9\u51e0\u4e2a\u9009\u62e9\u5668\u4ee5\u53cajQuery\u7684\u6ed1\u52a8\u6548\u679c\u201dslideUp\u201d\uff0c\u201dslideDown\u201d\uff1b<br \/>\n\u4e0d\u660e\u767d\u53ef\u4ee5\u53bb\u53c2\u7167JQ\u7684\u53c2\u8003\u6587\u6863\u3002\u5b8c\u6574\u7684\u5b9e\u4f8b\u8bf7\u8fd0\u884c\u4e0b\u9762\u7684\u4ee3\u7801\uff01<\/p>\n<div class=\"runcode\">\n<p><textarea name=\"runcode\" style=\"overflow-y:visible;width:600px;font-size:12px\" class=\"runcode_text\" id=\"runcode_Jn7Ujx\">\r\n&lt;!DOCTYPE html PUBLIC &quot;-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN&quot;&quot;http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd&quot;&gt;\r\n&lt;html xmlns=&quot;http:\/\/www.w3.org\/1999\/xhtml&quot; xml:lang=&quot;en-us&quot;&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;\u7528jquery\u5199\u4e00\u4e2a\u83dc\u5355\u4f38\u7f29\u6548\u679c&lt;\/title&gt;\r\n&lt;script src=&quot;http:\/\/code.jquery.com\/jquery-1.1.3.1.pack.js&quot;&gt;&lt;\/script&gt;\r\n&lt;script&gt;\r\njQuery(document).ready(function(){\r\n\tjQuery(&quot;dd:not(:first)&quot;).hide();\r\n\t\tjQuery(&quot;dt a&quot;).click(function(){\r\n\t\tjQuery(&quot;dd:visible&quot;).slideUp(&quot;slow&quot;);\r\n\t\tjQuery(this).parent().next().slideDown(&quot;slow&quot;);\r\n\t\treturn false;\r\n\t});\r\n});\r\n&lt;\/script&gt;\r\n&lt;style&gt;\r\nbody { font-family: Arial; font-size: 16px; margin: 0 auto; text-align: center; }\r\ndl,dt,dd,ul {margin: 0; padding: 0;}\r\ndl{margin-top: 150px;}\r\ndt { margin-top: 2px;}\r\ndt a {display: block; width: 300px; height: 30px; line-height: 30px;text-align: left; font-size: 18px;  padding-left: 5px; color: #FFF; background: #73C5E5;}\r\ndd {width: 303px; border: 1px solid #73C5E5;}\r\nul li{list-style: none; padding: 5px; text-align: left; }\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;dl&gt;\r\n\t&lt;dt&gt;&lt;a href=&quot;http:\/\/leotheme.cn\/&quot;&gt;jQuery&lt;\/a&gt;&lt;\/dt&gt;\r\n\t&lt;dd&gt;\r\n\t\t&lt;ul&gt;\r\n\t\t\t&lt;li&gt;&lt;a href=&quot;http:\/\/leotheme.cn\/&quot;&gt;Download&lt;\/a&gt;&lt;\/li&gt;\r\n\t\t\t&lt;li&gt;&lt;a href=&quot;http:\/\/leotheme.cn\/&quot;&gt;Documentation&lt;\/a&gt;&lt;\/li&gt;\r\n\t\t\t&lt;li&gt;&lt;a href=&quot;http:\/\/leotheme.cn\/&quot;&gt;Blog&lt;\/a&gt;&lt;\/li&gt;\r\n\t\t&lt;\/ul&gt;\r\n\t&lt;\/dd&gt;\r\n\t&lt;dt&gt;&lt;a href=&quot;http:\/\/leotheme.cn\/\/discuss\/&quot;&gt;JavaScript&lt;\/a&gt;&lt;\/dt&gt;\r\n\t&lt;dd&gt;\r\n\t\t&lt;ul&gt;\r\n\t\t\t&lt;li&gt;&lt;a href=&quot;http:\/\/leotheme.cn\/&quot;&gt;Mailing List&lt;\/a&gt;&lt;\/li&gt;\r\n\t\t\t&lt;li&gt;&lt;a href=&quot;http:\/\/leotheme.cn\/&quot;&gt;Tutorials&lt;\/a&gt;&lt;\/li&gt;\r\n\t\t\t&lt;li&gt;&lt;a href=&quot;http:\/\/leotheme.cn\/&quot;&gt;Demos&lt;\/a&gt;&lt;\/li&gt;\r\n\t\t\t&lt;li&gt;&lt;a href=&quot;http:\/\/leotheme.cn\/&quot;&gt;Plugins&lt;\/a&gt;&lt;\/li&gt;\r\n\t\t&lt;\/ul&gt;\r\n\t&lt;\/dd&gt;\r\n\t&lt;dt&gt;&lt;a href=&quot;http:\/\/leotheme.cn\/&quot;&gt;WordPress&lt;\/a&gt;&lt;\/dt&gt;\r\n\t&lt;dd&gt;\r\n\t\t&lt;ul&gt;\r\n\t\t\t&lt;li&gt;&lt;a href=&quot;http:\/\/leotheme.cn\/&quot;&gt;Themes&lt;\/a&gt;&lt;\/li&gt;\r\n\t\t\t&lt;li&gt;&lt;a href=&quot;http:\/\/leotheme.cn\/&quot;&gt;plugins&lt;\/a&gt;&lt;\/li&gt;\r\n\t\t\t&lt;li&gt;&lt;a href=&quot;http:\/\/leotheme.cn\/&quot;&gt;languages&lt;\/a&gt;&lt;\/li&gt;\r\n\t\t&lt;\/ul&gt;\r\n\t&lt;\/dd&gt;\r\n\t&lt;dt&gt;&lt;a href=&quot;http:\/\/leotheme.cn\/&quot;&gt;Themes&lt;\/a&gt;&lt;\/dt&gt;\r\n\t&lt;dd&gt;\r\n\t\t&lt;ul&gt;\r\n\t\t\t&lt;li&gt;&lt;a href=&quot;http:\/\/leotheme.cn\/&quot;&gt;BlueSky&lt;\/a&gt;&lt;\/li&gt;\r\n\t\t\t&lt;li&gt;&lt;a href=&quot;http:\/\/leotheme.cn\/&quot;&gt;Maxthon v2.0&lt;\/a&gt;&lt;\/li&gt;\r\n\t\t\t&lt;li&gt;&lt;a href=&quot;http:\/\/leotheme.cn\/&quot;&gt;simple-line&lt;\/a&gt;&lt;\/li&gt;\r\n\t\t&lt;\/ul&gt;\r\n\t&lt;\/dd&gt;\r\n&lt;\/dl&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/textarea><\/p>\n<script type=\"text\/javascript\">function changeTsize(){document.getElementById(\"runcode_Jn7Ujx\").style.height = document.getElementById(\"runcode_Jn7Ujx\").scrollHeight + \"px\";}window.setTimeout(changeTsize,0);<\/script><p><input type=\"button\" value=\"\u8fd0\u884c\" class=\"runcode_button\" onclick=\"runcode_open_new('runcode_Jn7Ujx');\"\/> <input type=\"button\" value=\"\u590d\u5236\" class=\"runcode_button\" onclick=\"runcode_copy('runcode_Jn7Ujx');\"\/> <input type=\"button\" value=\"\u53e6\u5b58\u4ee3\u7801\" class=\"runcode_button\" onclick=\"saveCode('runcode_Jn7Ujx','runcode_Jn7Ujx');\"\/> \u63d0\u793a\uff1a\u4f60\u53ef\u4ee5\u5148\u4fee\u6539\u90e8\u5206\u4ee3\u7801\u518d\u8fd0\u884c\u3002<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5148\u770b\u4e0b\u6548\u679c\u56fe\u5427\uff01\u5176\u5b9e\u662f\u4e00\u4e2a\u5f88\u7b80\u5355\u7684\u4e1c\u897f\u3002\u53ea\u662f\u5bf9\u4ee5\u524d\u7684\u77e5\u8bc6\u590d\u4e60\u4e0b\u3002\u8fd9\u91cc\u5c31\u4e0d\u505a\u8be6\u7ec6\u8bf4\u660e\u4e86\uff0c\u61c2\u5f97jQuery\u7684\u9009\u62e9\u5668 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[36,57],"class_list":["post-1193","post","type-post","status-publish","format-standard","hentry","category-jquery-2","tag-jquery","tag-57"],"views":733,"_links":{"self":[{"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/posts\/1193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1193"}],"version-history":[{"count":1,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/posts\/1193\/revisions"}],"predecessor-version":[{"id":1195,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/posts\/1193\/revisions\/1195"}],"wp:attachment":[{"href":"http:\/\/www.ntxz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1193"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}