SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Apr 2002
    Location
    Blacksburg, VA
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cell changes background on mouse over?

    I've seen this done before on different websites, but I don't have an example ATM.

    I would like, on this page, http://www.dreadedlegion.com/test.htm
    for the cell of the links under the logo to change backgrounds when someone move their mouse over it to go click on a link.

    I believe this is done with either DHTMl or JSCRIPT, I can't find it anywhere like the popular javascript sites.

    Also other suggestions are appreciated..

  2. #2
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The traditional hack is to add some inline javascript to the <td> tag, such as...

    <td onmouseover="this.style.background='#000000';" onmouseout="this.style.background='#FFFFFF';"> ... </td>

    However, a more correct method - and more standards compliant - would be to stop using tables/cells altogether, and add a CSS style to the <A> tag, such as:

    <style type="text/css">
    A.nav {
    display: block;
    background: #FFF;
    }
    A.nav:hover {
    background: #000;
    }
    </style>


    and declare the links as <a href="..." class="nav">...</a>

  3. #3
    SitePoint Member
    Join Date
    Apr 2002
    Location
    Blacksburg, VA
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, thanks for both of them 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
  •