...

View Full Version : Collapse link in Netscape



florida
11-09-2004, 12:06 PM
I have a JavaScript that has drop downs where it uses pluses and minuses to make the link expand or collaspe.

So for one of my collapse link like this:


+myLinkHere


If I click on the link it will be like this:


-myLinkHere
nextLink
anotherLink
moreLinks


It works great in IE and Netscape 7 but cant get it to work with Netscape 4 because it just stays expanded in Netscape 4 like this all the time:


-myLinkHere
nextLink
anotherLink
moreLinks

It will not collapse.

Is there something in NS4 or a script out there that will collapse and expand the links using Netscape 4??

Kor
11-09-2004, 12:14 PM
Collapse menu codes use, most of them, position:relative style, which is not recognizable by NS4.

On the other hand you might have document.getElementById(id) as a reference for object, while NS4 uses document.layers[id].

The solution is to use <layer><ylayer> nested tag markers and a small browsers detector -- if (document.getElementById)... else if(document.layers) --...

take care, the NS4 equivalent for
document.getElementById(id).style
is
document.layers[id]

Unfortunately I have not NS4 installed on this PC I am working now, so I can not build and test a variant for you (There is a long time since I have build such a code, so I reckon I don't remember those by heart) ... Try google for some older examples.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum