How to change ONLY the color of text on MouseOver/Out?

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved

Join Date: Dec 2007
Posts: 622
Reputation: OmniX is an unknown quantity at this point 
Solved Threads: 9
OmniX's Avatar
OmniX OmniX is offline Offline
Practically a Master Poster

How to change ONLY the color of text on MouseOver/Out?

 
0
  #1
Apr 18th, 2008
This is what happens:

I have an input submit button.
On mouse over text is changed from RED to WHITE.
On mouse out text is changed from WHITE to RED.

Simple eh?

Well IE does it fine but FF makes everything change to RED border, etc.

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. jscript:
  2. function over(button) {
  3. button.style.color = "#FFFFFF";
  4. }
  5.  
  6. function out(button) {
  7. button.style.color = "#FF0000";
  8. }
  9.  
  10. my input button:
  11. <input onMouseOver="over(this)" onMouseOut="out(this)" class="input" type="submit" id="input" name="input">

Any Ideas?

Thanks, Regards X
Last edited by OmniX; Apr 18th, 2008 at 4:42 am.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 622
Reputation: OmniX is an unknown quantity at this point 
Solved Threads: 9
OmniX's Avatar
OmniX OmniX is offline Offline
Practically a Master Poster

Re: How to change ONLY the color of text on MouseOver/Out?

 
0
  #2
Apr 18th, 2008
Figured out a solution using CSS.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,251
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 492
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: How to change ONLY the color of text on MouseOver/Out?

 
0
  #3
Apr 19th, 2008
Can you post that snipped of code so other can re-use it if they find themselfs in same situation?
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 622
Reputation: OmniX is an unknown quantity at this point 
Solved Threads: 9
OmniX's Avatar
OmniX OmniX is offline Offline
Practically a Master Poster

Re: How to change ONLY the color of text on MouseOver/Out?

 
1
  #4
Apr 19th, 2008
Well there is nothing about posting code as such as its more of a function.

I just used the 'hover' function in css to do the same thing(which was alot more friendlier).

Hover was never working for me before in FF and I think since the updates it does.

So the code would be in css:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. .class:hover {
  2. styles
  3. }

That good enough or should more detail be included?

Thanks, Regards X
Last edited by OmniX; Apr 19th, 2008 at 2:00 pm.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



Tag cloud for JavaScript / DHTML / AJAX
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC