{"id":396,"date":"2012-06-14T15:12:40","date_gmt":"2012-06-14T15:12:40","guid":{"rendered":"https:\/\/ibex.tech\/javascript\/?p=396"},"modified":"2022-02-17T07:14:47","modified_gmt":"2022-02-17T07:14:47","slug":"jquery-accordion","status":"publish","type":"post","link":"https:\/\/ibex.tech\/javascript\/accordion-concertina-menus\/jquery-accordion","title":{"rendered":"jQuery Accordion"},"content":{"rendered":"<p>This jQuery menu is great for vertical menus, but its limitation is that it won&#8217;t remember state when changing pages.<\/p>\n<p><a href=\"http:\/\/docs.jquery.com\/UI\/Accordion\" target=\"_blank\" rel=\"noopener noreferrer\">jQuery Accordion<\/a><\/p>\n<h5>In your header<\/h5>\n<pre><code>\r\n  &lt;!--JQuery Accordion menu start --&gt;\r\n  &lt;link href=\"http:\/\/ajax.googleapis.com\/ajax\/libs\/jqueryui\/1.8\/themes\/base\/jquery-ui.css\" rel=\"stylesheet\" type=\"text\/css\"\/&gt;\r\n  &lt;script src=\"http:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.5\/jquery.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"http:\/\/ajax.googleapis.com\/ajax\/libs\/jqueryui\/1.8\/jquery-ui.min.js\"&gt;&lt;\/script&gt;\r\n  \r\n  &lt;script&gt;\r\n  $(document).ready(function() {\r\n    $(\"#accordion\").accordion( {collapsible: true, active: false} );\r\n  });\r\n  &lt;\/script&gt;\r\n  &lt;!--JQuery Accordion menu end --&gt;\r\n<\/code><\/pre>\n<h5>In your HTML<\/h5>\n<pre><code>\r\n&lt;div id=\"accordion\"&gt;\r\n\t&lt;h3&gt;&lt;a href=\"#\"&gt;Section 1&lt;\/a&gt;&lt;\/h3&gt;\r\n\t&lt;div&gt;\r\n\t\t&lt;p&gt;\r\n\t\tSub 1\r\n\t\t&lt;\/p&gt;\r\n\t&lt;\/div&gt;\r\n\t&lt;h3&gt;&lt;a href=\"#\"&gt;Section 2&lt;\/a&gt;&lt;\/h3&gt;\r\n\t&lt;div&gt;\r\n\t\t&lt;p&gt;\r\n\t\tSub 2\r\n\t\t&lt;\/p&gt;\r\n\t&lt;\/div&gt;\r\n\t&lt;h3&gt;&lt;a href=\"#\"&gt;Section 3&lt;\/a&gt;&lt;\/h3&gt;\r\n\t&lt;div&gt;\r\n\t\t&lt;p&gt;\r\n\t\tSub 3\r\n\t\t&lt;\/p&gt;\r\n\t&lt;\/div&gt;\r\n\t&lt;h3&gt;&lt;a href=\"#\"&gt;Section 4&lt;\/a&gt;&lt;\/h3&gt;\r\n\t&lt;div&gt;\r\n\t\t&lt;p&gt;\r\n\t\tSub 4\r\n\t\t&lt;\/p&gt;\r\n\t\t&lt;p&gt;\r\n\t\tSub 5\r\n\t\t&lt;\/p&gt;\r\n\t&lt;\/div&gt;\r\n&lt;\/div&gt;\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This jQuery menu is great for vertical menus, but its limitation is that it won&#8217;t remember state when changing pages. jQuery Accordion In your header &lt;!&#8211;JQuery Accordion menu start &#8211;&gt; &lt;link href=&#8221;http:\/\/ajax.googleapis.com\/ajax\/libs\/jqueryui\/1.8\/themes\/base\/jquery-ui.css&#8221; rel=&#8221;stylesheet&#8221; type=&#8221;text\/css&#8221;\/&gt; &lt;script src=&#8221;http:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.5\/jquery.min.js&#8221;&gt;&lt;\/script&gt; &lt;script src=&#8221;http:\/\/ajax.googleapis.com\/ajax\/libs\/jqueryui\/1.8\/jquery-ui.min.js&#8221;&gt;&lt;\/script&gt; &lt;script&gt; $(document).ready(function() { $(&#8220;#accordion&#8221;).accordion( {collapsible: true, active: false} ); }); &lt;\/script&gt; &lt;!&#8211;JQuery Accordion menu end &#8211;&gt; In [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[60],"tags":[],"class_list":["post-396","post","type-post","status-publish","format-standard","hentry","category-accordion-concertina-menus"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/javascript\/wp-json\/wp\/v2\/posts\/396","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/javascript\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/javascript\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/javascript\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/javascript\/wp-json\/wp\/v2\/comments?post=396"}],"version-history":[{"count":3,"href":"https:\/\/ibex.tech\/javascript\/wp-json\/wp\/v2\/posts\/396\/revisions"}],"predecessor-version":[{"id":3227,"href":"https:\/\/ibex.tech\/javascript\/wp-json\/wp\/v2\/posts\/396\/revisions\/3227"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/javascript\/wp-json\/wp\/v2\/media?parent=396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/javascript\/wp-json\/wp\/v2\/categories?post=396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/javascript\/wp-json\/wp\/v2\/tags?post=396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}