Change "active" link appearance

P

Peter Aitken

I have what is probably a common setup. A 2-table cell has a list of links
in the left cell and an inline frame in the right cell. Clicking a link
loads the appropriate document into the frame. I want the link to change
appearance - in other words the link for the document that is loaded in the
frame will look different from the other links.

TIA,
 
P

Peter Aitken

Skydolphin said:
You just want to change the color of the active link?

alink=#009900 in your body tag. <body alink=#009900...

Hope that's what you are looking for.

Rhonda

Thanks but - please read my post again.
 
S

Steve Easton

She did, and she answered it.

add: body alink=#009900 to the opening body tag of your page. change the color
to one you want.


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed..................
...............................with a computer
 
P

Peter Aitken

Steve Easton said:
She did, and she answered it.

add: body alink=#009900 to the opening body tag of your page. change the color
to one you want.

My apologies - it does work. Not well, however, because the specified color
takes effect only after the mouse is moved off the link.

In any case I was hoping to change the text itself. For example when Link1
is active:
Link 2

And when link 2 is active:

Link 1
I though perhaps I could use the onclick event to change the innerText
property of the element but I don't know enough details to figure it out.
Mebbe it's time to buy a Javascript book!

Peter Aitken
 
S

Steve Easton

Peter,

There's a way to make the link change when clicked, and stay in that state until
another is clicked.
It's done using an active state in a style section.

Paste this in the head section of your page. Adjust colors and text decoration
as desired.


<style type="text/css">
a{
text-decoration: none;
}
a:link {
background-color: transparent;
color: #0000FF;
text-decoration: underline;
}
a:visited {
background-color: transparent;
color: teal;
text-decoration: none;
}
a:active{
background-color: transparent;
color: red;
text-decoration: none;
}
a:hover {
background-color: transparent;
color: #FF0000;
text-decoration: underline;
}
</style>

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed..................
...............................with a computer
 
P

Peter Aitken

Steve Easton said:
Peter,

There's a way to make the link change when clicked, and stay in that state until
another is clicked.
It's done using an active state in a style section.

<snipped>

thanks, Steve, I'll give it a try.
 
P

Peter Aitken

Steve Easton said:
Peter,

There's a way to make the link change when clicked, and stay in that state until
another is clicked.
It's done using an active state in a style section.

Paste this in the head section of your page. Adjust colors and text decoration
as desired.

<snipped>

I finally figured this out using a bit of javascript. I assigned an ID
attribute to each link. Then I used the onClick event for each to assign to
the innerText property:

<a onclick="first.innerText='>>Clinical Operations';
second.innerText='Services' " ID="first" target="main"
href="clinops_clinops_frame.htm">&gt;&gt;Clinical Operations</a></p>

<a ID="second" onclick="second.innerText='>>Services';
first.innerText='Clinical Operations'" target="main"
href="clinops_services_frame.htm">Services</a>>

Now the links look like this:
Services

or this:

Clinical Operations
depending on which is current.

Peter Aitken
 

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

Top