SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist Tapan's Avatar
    Join Date
    May 2005
    Location
    India
    Posts
    564
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Change bgimage of table cell

    Hi,

    I have a table with 8 cells. I have assigned a common background to each cell. I want to change the background of cell on mouse-over. How to do it ?

    Thanks.

  2. #2
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    Let's see if I can get this posted before some dumbass posts how to do it in jQuery.

    This belongs in CSS as there's NO reason to waste javascript on this.

    Target the Cell in CSS with the hover pseudo-state.
    Code:
    td:hover {
      background-image:url(images/hoverBackground.png);
    }
    That's it.

  3. #3
    SitePoint Evangelist Tapan's Avatar
    Join Date
    May 2005
    Location
    India
    Posts
    564
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by deathshadow60 View Post
    Let's see if I can get this posted before some dumbass posts how to do it in jQuery.

    This belongs in CSS as there's NO reason to waste javascript on this.

    Target the Cell in CSS with the hover pseudo-state.
    Code:
    td:hover {
      background-image:url(images/hoverBackground.png);
    }
    That's it.
    Works great! Thanks.


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
  •