Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i have a jquery accordions.when the user goes to another page,the opened accordion in previous opended page be opened here too. i dont know how i can save the opened accordion . this is my code:

<head>
<link href="jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="jquery.min.js"></script>
<script src="jquery-ui.min.js"></script>

<script>
$(document).ready(function () {
$("#accordion").accordion();
});
</script>
</head>
<body style="font-size:62.5%;">

 
<form id="form1" runat="server">

 
<div id="accordion">
 
<h3><a href="#">Section 1</a></h3>
<div>
<p>
Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. 
</p>
</div>
 
<h3><a href="#">Section 2</a></h3>
<div>
<p>
Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet
purus. .
</p>
</div>
<h3><a href="#">Section 3</a></h3>
<div>
<p>
Nam enim risus, molestie et, porta ac, aliquam ac, risus. 
</p>
<ul>
<li>List item one</li>
<li>List item two</li>
<li>List item three</li>
</ul>
</div>
<h3><a href="#">Section 4</a></h3>
<div>
 
<p>
Cras dictum. Pellentesque habitant morbi tristique senectus et netus
et malesuada fames ac turpis egestas.
</p>
<p>
Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus.
</p>
</div>
</div>

</form>
</body>
Posted
Updated 5-Feb-12 18:30pm
v2

1 solution

Handle the change event for the accordion control and store the index that was selected, then pass this to the next page and use the activate method for the accordion.

Its all in the documentation.http://jqueryui.com/demos/accordion[^]
 
Share this answer
 
Comments
maliheSadat 12-Feb-12 2:16am    
would u please give me an clear example?
that site gives some general example with no details!
[no name] 12-Feb-12 16:52pm    
What is unclear? Of course they are not going to provide a sample for your specific case.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900