Jump to content

Mouse Over Hyperlink that changes color of ALL hyperlinks except current


yandoo

Recommended Posts

Hi there,

 

I was hoping for a little help with my JS. I have a simple timetable that has about 6 different classes detailing times over a weekly timetable.

 

I want to make it so that when the mouse is hovered over one of the hyperlinks, that ALL the other hyperlinks text/table cell color changes. This would blend in with the background and dissapear from view, dislpaying ONLY the current class on the timetable.

 

 

If anybody could help me or  advise me of any guides/tutorials that would be great!

 

Thanks for listening

 

 

:)

give each link a unqiue id , then use a function like

function color(id1,id2,id3,id4,id5)

{

var i = 5;

while(i<=5)

{

document.getElementById(id+i).style.color="black";

}

}

then the link would be

<a href="" id="1" onmouseover="color("2","3","4","5","6");"></a>

<a href="" id="2" onmouseover="color("1","3","4","5","6");"></a>

<a href="" id="3" onmouseover="color("1","2","4","5","6");"></a>

<a href="" id="4" onmouseover="color("1","2","3","5","6");"></a>

<a href="" id="5" onmouseover="color("1","2","3","4","6");"></a>

<a href="" id="6" onmouseover="color("1","2","3","4","5");"></a>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.