#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2004
    Posts
    972
    Rep Power
    11

    Replacing background images on page with a new image


    Hi,

    I have some background images on the page, however, I want to replace them with a new background image using jQuery.

    I have this, but it doesn't work:

    PHP Code:
    $('td.my class').css('background-image','url(http://www.mywebsite.com/new-image.png)'); 
    Any ideas what I have wrong?

    Thanks
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2009
    Location
    Jakarta, Indonesia.
    Posts
    192
    Rep Power
    31
    $('td.my class')
    Does that selector suppose to select a descendant (which tagname is "class") of a table-cell (which classname is "my") ?

IMN logo majestic logo threadwatch logo seochat tools logo