Results 1 to 3 of 3

Thread: onmouseover/onmouseout

  1. #1
    Join Date
    Apr 2007
    Posts
    26
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default onmouseover/onmouseout

    I want to use this on my page:

    Code:
    <td onmouseover="style.backgroundColor=#990000" onmouseout="style.backgroundColor=#003366">
    But I do not want to write the color of the onmouseout (#003366). I'm looking for some script to change the color back to the original color (#990000) when the mouse moves away from the cell.

    Is this possible?

  2. #2
    Join Date
    May 2008
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    First you should wrap the color definition between single quotes ('')

    Then, leave the quotes for the onmouseout empty, so it takes the default color onmouseout.

    Code:
    <td onmouseover="style.backgroundColor='#990000'" onmouseout="style.backgroundColor=''">

  3. #3
    Join Date
    Apr 2007
    Posts
    26
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    hey it's that simple.

    thanks man

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
  •