0

I have created a jquery accordion menu inside a user control and used that user control in the project master page.

I want set the active index (Leave it open :)) of the accordion based on the hyperlink, the user is clicking.

User control code,

<div id="accordion1">       
    <div class="headeritem"><asp:Image runat="server" CssClass="headerimage" ImageUrl="" /><span class="headerspan">link1</span></div>
    <div class="content">
        <asp:HyperLink ID="hlMenuItem1" runat="server" Text="Search Appearances" NavigateUrl="" CssClass="menuitem"></asp:HyperLink>        
    </div>
    <div class="headeritem"><asp:Image ID="Image1" runat="server" CssClass="headerimage" ImageUrl="" /><span class="headerspan">Link2</span></div>
    <div class="content">
        <asp:HyperLink ID="hlMenuItem4" runat="server" Text="Published Feedback" NavigateUrl="" CssClass="menuitem"></asp:HyperLink>        
    </div>
</div>

How can I save the index value when the link is clicked?

Joshua
  • 2,275
  • 7
  • 41
  • 57
  • 1
    This thread may help: http://stackoverflow.com/questions/588030/link-to-open-jquery-accordion – Billy Moat Jan 30 '13 at 14:45
  • To Open a specific panel you can use the active param like `$("#accordion1").accordion({ active: 1 });`. For getting this index you might need to do some jquery find to get the position in your dom and call accordion appropriately. – Ravi Y Jan 30 '13 at 14:47
  • @BillyMoat Is there anyway without using querystring? – Joshua Jan 30 '13 at 14:54
  • @Joshua - Not sure I'm afraid. Here's the API Documentation if it's the jQuery UI Accordion that you're using: http://api.jqueryui.com/accordion/ – Billy Moat Jan 30 '13 at 14:59

1 Answers1

0

I passed the index through a query string and retrieving that value to set the active index.

Joshua
  • 2,275
  • 7
  • 41
  • 57