• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

how do i change the color onmouseover & out of links

How can i make it so when someone's mouse is over a link it would be one color and another when the mouse is not over?
0
Acocite
Asked:
Acocite
  • 6
  • 5
  • 2
  • +1
1 Solution
 
tpryorCommented:
javascript.

for instance,

>>store an image of the color to turn to (when mouse over) in a image var, ex:

 <SCRIPT LANGUAGE="JavaScript">

  <!-- HIDE

var menu = new Image();

        menu.src = "../gifs/mainmenu.gif";

 //STOP HIDING-->

>>name your image tag, ex:

<IMG SRC="../gifs/mainmenu.gif" NAME="Mainmenu" WIDTH="295" HEIGHT="405" ALIGN="BOTTOM">

>> include this code in the anchor tag..

<A HREF="bikes.htm" onMouseOver="Mainmenu.src='../gifs/mainmen1.gif';return showStatus(' ')"
onMouseOut="Mainmenu.src='../gifs/mainmenu.gif'">
-- Place above code here --
</a>

That's it.

GL
t

0
 
AcociteAuthor Commented:
Yes, but how can i do it with text, instead of images? worth an extra 50 pts.
0
 
treyjeffCommented:
Like a link?  I have links on my page that change color when the mouse moves over them.  It might be able to be used with text, I'll try to test it.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
AcociteAuthor Commented:
Yeah, like a link.
0
 
treyjeffCommented:
Reject the propsed answer and I'll answer with what I use on my homepage.
0
 
AcociteAuthor Commented:
first answer rejected
0
 
Holger101497Commented:
I can reliably tell you that it is NOT possible to change the color of "normal" text links without using DHTML / CSS. It can't be done in browsers other than Netscape 4 / IE 4 but the solutions are fairly different for the two and it's a real pain!
0
 
treyjeffCommented:
Here is how you do it:

<a href="destination.htm"><font face="Verdana" color="#000000" onmouseover="this.style.color = '#ffffff'" onmouseout="this.style.color = '#000000'">Destination Pages</font></a>

This will make a link called Destination Pages that will go to destination.htm  Link will be black and then white when the mouse moves over the link.  I use this on my page.
0
 
AcociteAuthor Commented:
I've tried using the text you gave me Treyjeff but it just doesn't work. Could their be some other tag somewhere in your document that i might need to make it work?
0
 
treyjeffCommented:
What browser are you using?
0
 
AcociteAuthor Commented:
How am i supposed to use "Dhtml/Css"?
0
 
AcociteAuthor Commented:
ie 4.0
0
 
treyjeffCommented:
With what I gave you, you don't need DHTML or CSS.  I have uploaded a sample for you at http://www.huron.net/~jlewis/sample.htm
Check it out and it will work for you.
0
 
Holger101497Commented:
> With what I gave you, you don't need DHTML or CSS
Do you even know what these terms mean? CSS= Cascading STYLE sheets.

What would you call onmouseover="this.style.color = '#ffffff'" ?

btw. your uploaded example doesn't work in Netscape.
Kind of what I said: The solution is a pain, and different for the two browsers! I regret not having enough time right now to play around and find a way to make it work in both browsers...

Good luck anyway! :-)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 5
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now