943,580 Members | Top Members by Rank

Ad:
Apr 18th, 2008
0

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

Expand Post »
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.
Similar Threads
Reputation Points: 31
Solved Threads: 10
Practically a Master Poster
OmniX is offline Offline
652 posts
since Dec 2007
Apr 18th, 2008
0

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

Figured out a solution using CSS.
Reputation Points: 31
Solved Threads: 10
Practically a Master Poster
OmniX is offline Offline
652 posts
since Dec 2007
Apr 19th, 2008
0

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

Can you post that snipped of code so other can re-use it if they find themselfs in same situation?
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 871
Code tags enforcer
peter_budo is offline Offline
6,653 posts
since Dec 2004
Apr 19th, 2008
1

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

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.
Reputation Points: 31
Solved Threads: 10
Practically a Master Poster
OmniX is offline Offline
652 posts
since Dec 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Random image with text and link
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: if statement not working





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC