Jason Chandler

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromJason Chandler
ToMe
SubjectHelp with Nesting List Collapsing Script...
Date30 June 2004 15:45
Let me start by saying that this is a wonderful script! I am attempting to
use it to expand/collapse Q and A's on a FAQ page at xxx.xxxxxxxxxxxxxx.xxx
(not uploaded yet). I wanted to know whether this can be done, and if so
what would be the best approach?

    Single page, multiple columns of text.
    
    Each section contains a ul element with unique ID
    
    li are arranged as: li (heading), ul li (sub category)

This part i understand. I need to know the best way to collapse all of
these lists using the following method:
    
     <script type="text/javascript" language="javascript1.2"><!--
        window.onload = function () {
       //no auto-child-collapse
       compactMenu('someID',false,'± ');
       //auto-child-collapse
       compactMenu('someID',true,'± ');
        }   
    //--></script>

Do I simply repeat the script or can i just seperate the ID callouts using
a ";". Any help you could provide is much appreciated.

Again, this script is fantastic and may prove to be very well suited for
more that just navigation...


~jason
FromMe
ToJason Chandler
SubjectRe: Help with Nesting List Collapsing Script...
Date1 July 2004 20:30
Jason,

If your structure is something like this:
<ul id="faqSection1">
    <li>
        etc.
    </li>
</ul>
...
<ul id="faqSection2">
    <li>
        etc.
    </li>
</ul>

Then you would call it like this:

<script type="text/javascript" language="javascript1.2"><!--
window.onload = function () {
    //auto-child-collapse
    compactMenu('faqSection1',true,'± ');
    compactMenu('faqSection2',true,'± ');
};
//--></script>

You can put as many calls in there as you need. Every child branch will be
collapsed starting at the level of the ULs with the IDs that you specify.


Hope this helps. If it is not what you needed, send me a prototype of the
page as it is now and I will show you how to work the script around it.


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.