View Single Post
Old 11-09-2011, 10:35 AM   PM User | #1
vabrown89
New to the CF scene

 
Join Date: Nov 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
vabrown89 is an unknown quantity at this point
Spry Accordion issue with links and open panels

Hi, I am using a spry accordion as a navigation bar. The tabs are the main links and I have sub-links inside the content panels.

The problem is that although I am using script to specify which panel I want to be open on each page, when I go to that page it only highlights the tab, showing that it is selected but not open. This means you then have to click the tab again in order to open the sub menu. I want the content panel to be open on those pages that are linked to by a sub menu.

This is the code I am using, according to the multiple sites I have found it it SHOULD open the panel, but it doesn't:

Code:
<script type="text/javascript"> var Accordion1 = new Spry.Widget.Accordion("Accordion1", { enableAnimation: true, useFixedPanelHeights: false, defaultPanel: 4 });  </script>
It works for the first tab but I suspect this is because the default in the js is set to 0 like so:

Code:
Spry.Widget.Accordion = function(element, opts)
{
	this.element = this.getElement(element);
	this.defaultPanel = 0;
I have just started to learn all this so please don't mock me if this is an ignorant question, what am I doing wrong?
vabrown89 is offline   Reply With Quote