Keith Simpson

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromKeith Simpson
ToMe
SubjectNested list collapsing script - collapse behaviour not as expected
Date18 February 2008 06:18
Hi,

First off, thanks for a great site which will take me ages to explore.

My problem: I am using the Nested list collapsing script with cookies to
remember the menu state but this isn't working as I expected it to. For
example, using something like:

|<ul id="someID">
 <li>Book 1
   <ul>
     <li><a href="someHref">Chapter 1</a></li>
     <li><a href="someHref">Chapter 2</a></li>
     <li><a href="someHref">Chapter 3</a></li>
     <li><a href="someHref">Chapter 4</a></li>
   </ul>
 </li>
 <li>||<a href="someHref">||Book 2>/li>     <li>Book 3
   <ul>
     <li><a href="someHref">Chapter 1</a></li>
     <li><a href="someHref">Chapter 2</a></li>
     <li><a href="someHref">Chapter 3</a></li>
     <li><a href="someHref">Chapter 4</a></li>
   </ul>
 </li>
</ul>|

When using the menu to navigate between Book 1 Chapter one to Book 2, the
submenu for Book 1 remains open and visible. Is it possible to collapse the
menu for Book 1 in the above example?

As you may have guessed, I am virtually useless at javascript so if you do
provide help, please make it simple!

Once again, many thanks for a great site.

Keith Simpson
FromMe
ToKeith Simpson
SubjectRe: Nested list collapsing script - collapse behaviour not as expected
Date22 February 2008 15:14
Keith,

> Is it possible to collapse the menu for Book 1 in the above example?

Sounds like you are using the wrong options. You should not be using the
cookie state. You should be using the selfLink function to make it show the
link to the current page. Examples are given here:
http://www.howtocreate.co.uk/tutorials/jsexamples/listCollapseExample.html


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.