Results 1 to 3 of 3

Thread: Highlight Table Cells Script

  1. #1
    Join Date
    Sep 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool Highlight Table Cells Script

    Hello I am using the script from:

    http://www.dynamicdrive.com/dynamici...lighttable.htm

    My goal is to have an entire table row change to a light yellow with the onMouseover command, as in the script above. It works great, except for the fact every other table row in my table is a light grey. The rows which are "white" work. The "greys" don't.

    When you specify it to highlight "TD" instead of "TR" the table cell color does not matter, white or grey, it will change any indvidual cell you rollover to "light yellow". I really want it to work for the "TR" so I can highlight entire rows.

    I have placed my Javascript in a file named tables.js. It is the same code found at the link above, except I am using the "TR".

    here is my page: http://www.fantasy.altcool.com/2005/standings.html

    Any help is much appreciated!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The problem is that for the gray rows, you've applied a background color to each cell. Because of this, the background color of the row cannot show through. Change this type of markup (used for each gray row):
    HTML Code:
            <tr onMouseover="changeto(event, '#FFFFCC')" onMouseout="changeback(event, '#F1F2ED')"> 
              <td bgcolor="#F1F2ED">&nbsp;2</td>
              <td bgcolor="#F1F2ED">Alaskan Thunder-Phuk</td>
              <td bgcolor="#F1F2ED">0-0-0</td>
              <td bgcolor="#F1F2ED">0.000</td>
              <td bgcolor="#F1F2ED">&nbsp;</td>
              <td bgcolor="#F1F2ED">&nbsp;</td>
            </tr>
    to this type:
    HTML Code:
            <tr bgcolor="#F1F2ED" onMouseover="changeto(event, '#FFFFCC')" onMouseout="changeback(event, '#F1F2ED')"> 
              <td>&nbsp;2</td>
              <td>Alaskan Thunder-Phuk</td>
              <td>0-0-0</td>
              <td>0.000</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
    and all should work as you want it to.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Sep 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks! I swore I tried that already...but I guess I did not? Thanks for the quick response.
    Last edited by echristo66; 09-26-2005 at 08:24 PM.

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
  •