Default Functionaility
Menu 1
To remove accordion menus:
$("selector").accordion("destroy");
More info on all of the accordion's options can be
found here.
Menu 2
This is an accordion menu using default values. Each section is made of a header and a panel (contents) that is shown when the header is clicked. A transition animation is played to smoothly navigate between section.
Code
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.4/themes/cupertino/jquery-ui.css" type="text/css"/>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>
<script type="text/javascript">
// $(function() { code }); executes the contained code when the DOM is finished loading
$(function()
{
$("#example").accordion(); // Call the accordion method on the element with the id example
});
</script>
</head>
<body>
<div id="example">
<h3>Menu 1</h3>
<p>This is some placeholder content in a p element.</p>
<h3>Menu 2</h3>
<p>This is more placeholder content in a second p element.
It is coded directly below an h element which jQuery's
accordion method turns into the header you see above this content.
</p>
<h3>Code</h3>
<pre> *** This is what you are viewing *** </pre>
</div>
</body>
</html>