Results 1 to 2 of 2

Thread: Problem with addClassName and moseOver

  1. #1
    Join Date
    Jul 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Problem with addClassName and moseOver

    Hi,

    I'm using the follwing code and css to highlight and underline the text once the mouse is hovered on the image.The text is changing the color once I hover on the image but it's not underlining the text although I have text-decoration:underline on css property.Could any body help me on this.
    <code>
    <a rel="nofollow" href="sample1.jsp" onmouseover="$('sampletext').addClassName('m-over');"
    onmouseout="$('sampletext').removeClassName('m-over');"><img src="test1.gif/>
    <a rel="nofollow" id="sampletext">Example1</a>
    a:m-over{
    colorrange:
    text-decoration:underline
    }
    </code>
    Thanks,
    Kumar
    Last edited by areddy; 07-27-2009 at 05:38 PM.

  2. #2
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    I first thought this should be posted in the javascript/jQuery section, but I see now that this is actually a CSS flub...

    You are using your CSS classname improperly. You should use a.m-over rather than a:m-over.

    Secondly, there is no CSS property of "colorrange"... If you would like to change the color of text using CSS, simply use "color" instead. Also, after each property/value combo, there must be a semi-colon in your css...

    Try using:

    Code:
    a.m-over{
    color:red;
    text-decoration:underline;
    }
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

Bookmarks

Posting Permissions

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