I have a 3 tab Accordion style set to be my navigation panel on a website I'm building.
I want the other tabs to close when another is selected. Can someone help me with the JS coding for that?
@CF McBlob: OP is referring to a 'jQuery' plugin, not Spry. While your support is highly appreciated, please analyze the original questions thoroughly before responding to ensure posters don't get confused.
@AxiomaticChaos: What jQuery plug-in are you using for the 'accordion'? Or have you built one from scratch yourself? Can you post the webpage in question so we can analyse? Or at the very least, post your code.
However, here are 2 great free-to-use jQuery accordion plugins that you could take a look at:
I'm using the scripting from Akordeon, and I've edited to match my scheme.
Here is the coding:
This is what I have. Any advice on how to make all 3 tabs closed on the webpage open? as well as force closing an open tab when another is selected?
It'd be best if you could upload this to your webserver and share a link - would be easier for us to troubleshoot.
I believe that the behaviour that you are looking for is the default behaviour. The constructor should look like
If you want the third panel to be open as your default you need to add 'expanded' to the division as in
<div class="akordeon-item expanded">