Dale Chapman

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromDale Chapman
ToMe
Subjectnested list collapse and IE Mac?
Date5 October 2004 16:33
I can't seem to get IE 5.2 mac to load pages that use the nested list 
collapse script.

Do you know of any way to get it to work?

-Dale
FromMe
ToDale Chapman
SubjectRe: nested list collapse and IE Mac?
Date5 October 2004 08:54
Dale,

Stupid browser :(  Oh well, it always did have a problem with childNodes
collections. My apologies, I hit a bug in IE Mac and I hadn't noticed.

I have uploaded a new version that also works in IE Mac.
http://www.howtocreate.co.uk/jslibs/


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromDale Chapman
ToMe
SubjectRe: nested list collapse and IE Mac?
Date5 October 2004 22:04
You are (simply put) a God!

Your site is extremely useful to designers who are trying to be smart boys
(learn javascript/PHP, etc).

many many thanks

---

By the way,

I'm intending to use this script for my site navs, and tried (without much
success) to cobble together an addition to your script that would expand
the list to highlight the currently loaded page and give that link a
selected style.

It seems like if that were possible, you'd have a nav that could be
completely modular, that is, you could edit it on one place and serve it on
all your pages with a server side include. Very cool.

Let me know what you think, or alternately if I took up too much of your
time already, accept my big thanks for your site.
FromMe
ToDale Chapman
SubjectRe: nested list collapse and IE Mac?
Date6 October 2004 00:04
Dale,

I am working on this as an enhancement. I hope to have it finished tomorrow.
FromMe
ToDale Chapman
SubjectRe: nested list collapse and IE Mac?
Date6 October 2004 13:49
Dale,

I made the upgrade to the script, it can now automatically highlight links
(and expand to show them) that point to the current page.

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

Tarquin
FromDale Chapman
ToMe
SubjectRe: nested list collapse and IE Mac?
Date6 October 2004 20:09
Thanks for all your help.

Is there something special I need to do to help the script recogniz(s)e
what page I'm on and compare it to the link? I enabled it as the
instructions say, but the list does not pop open. Does the script use
title or link?

you can see the testing page at xxxxxx.xxx

There's a sliding div there that isn't working on windows yet, don't
let it bother you. 

Thanks much
-D 
FromMe
ToDale Chapman
SubjectRe: nested list collapse and IE Mac?
Date6 October 2004 21:11
:)

nice looking list. I see the problem (you may have noticed this yourself).
your links point to index.htm, but pages are served just using /
So you load the root page, and the links do not show. that is because they
point to /index.htm not /

Note, there is no need for you to ever refer to index.htm

on virtually every server, index.htm is served as the index page for the
directory (some IIS servers use default.htm or main.htm), so all you need
is to use <a href="./"> instead of <a href="index.htm">

To summarise:
http://yourdomain.com/ is _not_ the same as http://yourdomain.com/index.htm
FromDale Chapman
ToMe
SubjectRe: nested list collapse and IE Mac?
Date6 October 2004 21:38
Wow, you learn something every day, so how would I have other pages that
use the same nav be recogniz(s)ed by the javascript. Say 'contactUs.htm'
instead of 'index.htm' (or './')

Don't mean to be tiresome.
FromMe
ToDale Chapman
SubjectRe: nested list collapse and IE Mac?
Date6 October 2004 22:09
> Wow, you learn something every day, so how would I have other pages that
> use the same nav be recogniz(s)ed by the javascript. Say 'contactUs.htm'
> instead of 'index.htm' (or './')

since you will only ever refer to contactUs.htm by its proper name, there
is no need to do anything other than what you would normally do.

The only reason that index.htm caused a problem is that the index file is
special. you can refer to it using two different paths, and you used both,
which confused the script (index.htm in the link, and / in the address)

> Don't mean to be tiresome.

No problem :) we all have to learn from somewhere
FromDale Chapman
ToMe
SubjectRe: nested list collapse and IE Mac?
Date6 October 2004 22:35
Hi Mark

here's what I did:

           <li><a href="./">work</a></li>
              <li><a href="B.htm">annual reports</a></li>
              <li><a href="C.htm">events</a></li>
              <li><a href="D.htm">sites</a></li>
            </ul>

but it still doesn't bust open these open on their respective pages. 
what am I doing wrong?

-Dale
FromMe
ToDale Chapman
SubjectRe: nested list collapse and IE Mac?
Date7 October 2004 9:50
Dale,

sorry about that. teach me to rush things. I was using only Opera while I
was testing, which actually gets it right. The reason it was not working is
that the other browsers do not correctly implement link.hash (even though
it has been documented since Netscape 4). I have modified the script to
compensate for this. I also noticed that IE incorrectly interferes with
port numbering when reading the page address, so I have also compensated
for that. phew.

If you download the new one, it should work (I tested it in everything this
time, just to be sure).

Tarquin
FromDale Chapman
ToMe
SubjectRe: nested list collapse and IE Mac?
Date7 October 2004 20:27
Awesome! The only thing I'm now having trouble with is getting it to pick
up the class stylings for that item. I'll keep working on it, but if you
just happen to know why not perhaps you could point me in the right
direction.

Thanks so much for this script. Perhaps I can help you with design sometime
in exchange
FromMe
ToDale Chapman
SubjectRe: nested list collapse and IE Mac?
Date7 October 2004 21:54
Two things:

1) this is not valid:
.selected, selected a, selected ul ul a,  {

the last character just before the { should not be a ,
also, selected is a class, not an element
try just this:
.selected {

2) I discovered another browser bug that you have run into. Please download
the latest version ...


I hope for your sake that we've got it this time :) 
FromDale Chapman
ToMe
SubjectRe: nested list collapse and IE Mac?
Date11 October 2004 21:15
Just wanted to say thanks for your script and for your help with 
extending it and configuring it.

I'm trying to learn as much javascript as I can, but it's slow going. 
Your site has been an invaluable resource.

I have some ideas for useful PHP content management stuff. Sometime if 
you ever lack for things to develop (not bloody likely, I'm guessing) 
let me know, and I'll hold forth.

Thanks again. Once again great site, I'm thinking of doing a skin for 
it.
FromDale Chapman
ToMe
SubjectNested Collapse :: Selected class on directory link
Date10 March 2005 23:28
Hi,

Thanks for a great script, ie.
http://www.howtocreate.co.uk/tutorials/jsexamples/listCollapseExample.html

I'd like to use it with a cms that uses directory links, rather than page
links.

eg.

http://example.com/dir1/dir2

instead of

example.com/dir1/dir2/page.htm

Your script doesn't appear to match up the page with the appropriate link
in the li and apply the class 'selected'. could it be adapted to do so?

Thanks much

-Dale
FromMe
ToDale Chapman
SubjectRe: Nested Collapse :: Selected class on directory link
Date16 March 2005 13:05
Hi again Dale,

> I'd like to use it with a cms that uses directory links, rather than page
> links. eg.
> http://example.com/dir1/dir2

Your problem is that this is not a valid path to a directory. Directories
have a trailing /

If you go to http://example.com/dir1/dir2 you are redirected automatically
because most servers are smart enough to realise you forgot the / but the
list still has the wrong link. Use the correct path with a trailing / and
the script should work:
http://example.com/dir1/dir2/


Tarquin
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.