Welcome, Guest. Please login or register.
Did you miss your activation email?
February 12, 2012, 03:13:22 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
149621 Posts in 21098 Topics by 7537 Members
Latest Member: lotte2
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Jquery accordion - active element  (Read 2384 times)
friet

Offline Offline

Posts: 12


« on: October 08, 2009, 12:58:34 PM »

I'm using the show_menu2 function to make a jquery accordion menu.
My menu looks like this:

Page1
-Subpage1
-Subpage2
Page2
-Subapge3
etc...

You get the idea.
This is my accordion code:
Code:
<script type="text/javascript">
  $(document).ready(function(){
    $("#accordion").accordion({ autoHeight: false });
  });
</script>
and the menu code:
Code:
$menuestring1='[if(level==3){<h3><a href="#">[menu_title]</a></h3>} else {<li><a href="[url]">[menu_title]</a></li>}]';
                            $menuestring2='[if(level>3){<div><ul>}]';
                            show_menu2(0,SM2_ROOT+3,SM2_START+2,SM2_ALL|SM2_PRETTY,$menuestring1,'',$menuestring2,'</ul></div>','','');

It's based on some code i got from the forum.

Now the problem is, when i click on subpage 3, I want the second accordion-part to be open when my browser loads that page. In the accordion you can define what part should be open (with active: <number>) but how do I detect on what subpage I clicked thus what accordionpart should be opened?
« Last Edit: October 08, 2009, 01:02:50 PM by friet » Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!