Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Posts
    567
    Thanks
    2
    Thanked 4 Times in 4 Posts

    AGHHHHH! onMouseOver not working!

    There is absolutely nothing wrong with this.

    Code:
        function colorit(which){
          which.style.color='red';
        }
        
        function uncolorit(which){
          which.style.color='blue';
        }
    But it wont work. I have put alerts in them and they are being called. color is the real name of the property which is a property of the style.

    If I use #FF0000 instead of red I get an 'invalid character' error.

    Did I mispell which or something?
    Scott Stewart
    Always happy to learn from pros.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Two things:

    1. We need to see an example link which uses those functions since the problem may not be in the functions themselves (IE, you may be calling them wrong).

    2. The effect you are getting via javascript is more easily accomplished using just CSS alone and the CSS only solution will work for people who have javascript disabled.

    -- for the stylesheet:
    a.linkclassname { color: red; }
    a.linkclassname:hover { color: blue; }

    -- html:
    <a href="yonderpage.htm" class="linkclassname">Yonder</a>
    Check out the Forum Search. It's the short path to getting great results from this forum.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •