yandoo Posted July 21, 2008 Share Posted July 21, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/115889-mouse-over-hyperlink-that-changes-color-of-all-hyperlinks-except-current/ Share on other sites More sharing options...
DeanWhitehouse Posted July 21, 2008 Share Posted July 21, 2008 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> Quote Link to comment https://forums.phpfreaks.com/topic/115889-mouse-over-hyperlink-that-changes-color-of-all-hyperlinks-except-current/#findComment-595914 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.