Active link problem driving me nuts!!!

F

Fran Cotton

How do you stop the "active link" colour from disappearing when you click on
a div or span
part of a javascript tree that doesn't result in a new page being displayed,
only a new branch
being opened or closed?

I'll clarify further:

Imagine the following tree where (h) means the node is a hyperlink:

Products
product a (h)
product b (h)
Services
IT
bespoke software (h)
Eductation
tutoring (h)
consultancy (h)
About Us (h)

If I select About Us, my main frame updates and About Us turns green ( my
active link colour ) as expected.
If I then click on tutoring, the green colour shifts and the frame updates
as expected. However, if I then click
on IT, I lose the active link on tutoring!! This shouldn't happen as the
tutoring page is still being shown in the
main frame. The tutoring tree node shouldn't lose its active link colour as
IT is a branch in a tree, not a leaf node
or document to be rendered and hence be active.

Many thanks in advance! ( this is driving me nuts! )

btw, I'm using Internet Explorer 5.5 if that helps.

Fran
 
R

Russ Edkins

Hi Fran,

If I've understood you correctly, the reason your previously active
link loses it's colour, is because it is loosing focus when you click
on the DIV or SPAN, and hence is no longer the active item, even
though your content may not have changed. I think you'll need to try
something other than using CSS psuedo classes :)active, :link etc.) to
drive colours. It sounds like what you're essentially asking is that
the highlighted link is tied directly to the currently displayed
content. If you're using frames, you could maybe do something like...

<a href="#" style="color:expression(parent.content.location.href.indexOf('productA')!=-1
? 'green' : 'blue')">Product A</a>

....but this relys on you being able to identify a unique string in the
HREF of each page, it will only work in IE5+ and it could add quite a
lot of weight to the page, so without more info on your set up and
audience I can't say if this will definitely work.

You could also make each content frame set the colour of it's
corresponding HREF.

I would imagine there are lot of other ways too, but I just don't
think you can rely on A.active psuedo class, and you'll need to try
something different.

HTH

Russ.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top