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

 

 

:)

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.