3 replies [Last post]
CarloMonte
Offline
newbie
Last seen: 17 years 3 weeks ago
Joined: 2004-01-05
Posts: 1
Points: 0

Hi

I would like to have the link showing the current page you are in using CSS.

How do you change the class from ie. class="link" to Class="Currentlink"
when you click the link??

Then when you click on another link (i'm doing this on a navigation bar) the class on that link changes to "Currentlink" and the previous link changes back to "link"

Is this possible just using CSS :?

Daybreak_0
Offline
Enthusiast
Sydney, Australia
Last seen: 17 years 10 weeks ago
Sydney, Australia
Timezone: GMT+10
Joined: 2003-11-15
Posts: 389
Points: 0

Changing link classes of the page that's currently open?

Well - when you click a link then the browser will load the page that you clicked.

On the new page that loaded for the link you clicked the class for the link that you clicked will be class="currentlink"

But on the previous page you were viewing its class was class="link"

In other words a link to a page, which you are currently viewing will have a class="currentlink"

Hope that made sense.

Regards
Day

The only way to learn is to do it yourself

Daybreak_0
Offline
Enthusiast
Sydney, Australia
Last seen: 17 years 10 weeks ago
Sydney, Australia
Timezone: GMT+10
Joined: 2003-11-15
Posts: 389
Points: 0

Changing link classes of the page that's currently open?

Quote:

Thanks for the info.
the navigational bar i am using in a separate file and is dynamically included in everypage (using coldfusion). Therefore from what you have said i don't think this can be done! Maybe i'm wrong!!
Thanks again

You are correct, unless cold fusion has some script that will do it or you use javascript to determine what page is showing.

People that use SSI (Server Side Includes) or frames would have the same problem.

Regards
Day

The only way to learn is to do it yourself

dJomp
dJomp's picture
Offline
Enthusiast
Last seen: 4 years 51 weeks ago
Joined: 2003-03-23
Posts: 422
Points: 0

Changing link classes of the page that's currently open?

'ere, where did that post go? I've just got Day's 2 replies here...

You know you're a geek when you try to shoo a fly away from the monitor with your cursor.