James Rands

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromJames Rands
ToMe
SubjectList Collapse Code Expansion Needed ASAP
Date9 September 2004 14:07
Hi, I've come across your site and have experimented with the code
available on the link below.

http://www.howtocreate.co.uk/tutorials/jsexamples/listCollapseExample.html

Although this scipting technique is really good, I have an issue in regard
to keeping the navigation expanded when you load a page from a link
reference.

While I wait for a response from you I'm going to try and expand on the JS
code to write a session cookie function to remember what should be open or
not when a link is hit and the page reloads.

Hope to hear from you soon
Regards
James
FromMe
ToJames Rands
SubjectRe: List Collapse Code Expansion Needed ASAP
Date9 September 2004 14:50
James,

I'm afraid that is a limitation with this script, as it says on the page
'It also collapses all branches first, none can be left open by default
like they can with the collapsible list script.'. While I'm sure it is
possible, I do not really have the time to write this functionality into
the script at the moment.

If you want to write it, you are welcome to. I would recommend that you
start _after_ the list has been collapsed, and then expand the required
branches again, by simulating clicks on the links: blah.onclick();


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromJames Rands
ToMe
SubjectRe: List Collapse Code Expansion Needed ASAP
Date9 September 2004 15:27
Mark, thanks for the quick response to this - I realise now that you're
busy, but are you available for advice via email on this in the near future.
I'd like to nail this by close of UK play tomorrow so any further help is
much appreciated. If I arrange a budget for the additional functionality
could you find time to help me? Please let me know who much you'd require
to complete the additional work.

Regards

James
FromMe
ToJames Rands
SubjectRe: List Collapse Code Expansion Needed ASAP
Date9 September 2004 19:05
Well, you got me thinking, and I realised that there is a blindingly easy
way to do this, so I wrote it.
The new version is available online:
http://howtocreate.arendal.ourhouse/jslibs/
And you can see the demo:
http://howtocreate.arendal.ourhouse/tutorials/jsexamples/listCollapseExample.html
You will also need a cookie script. My cookie script is available on the
same download page.

Tarquin
FromJames Rands
ToMe
SubjectRe: List Collapse Code Expansion Needed ASAP
Date10 September 2004 14:09
Thanks, got this working sweet, however I still have one remaining question,
how do I apply page links to expanding node ref's  eg I've tried wrapping a
link around but no joy - is there something I can do to alter the JS file?

<ul>
 <li>i need this to be a link and expand the structure when clicked
  <ul>
   <li><a href="1.html">Chapter 1</a></li>
   [ ... etc ... ]


Cheers

James
FromMe
ToJames Rands
SubjectRe: List Collapse Code Expansion Needed ASAP
Date10 September 2004 14:23
The script does support links in the branches,
<li><a href="whatever">Chapter 3</a>
 <ul> etc.
but you must not use the display:block; style for links, or the ± sign and
the link appear on separate lines (you could use the inline-block style,
but Mozilla and IE do not support it).

It will end up with a ± sign to expand/contract, and whatever link you put
as the link to the other page.
FromJames Rands
ToMe
SubjectRe: List Collapse Code Expansion Needed ASAP
Date10 September 2004 15:42
Hi, I'm still getting 2 lines, 1 for the +/- link and another for the
actual page link?

Here's the code.
...
li a {
  ...
  width: 100%;
  ...
}

Thanks for your time,

James
FromMe
ToJames Rands
SubjectRe: List Collapse Code Expansion Needed ASAP
Date10 September 2004 15:59
oops, yeah, IE (and I seem to remember a couple of others) will treat
width: 100% as if it were display: block. you will need to remove that as
well.
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.