Back Home

Open Designs

Community. Driven.

  1.  
    I am working with Ubercart and Drupal and I would like a javascript code that would change the class names of the product image from nothing to "reflect" the path to the img tag I want the class applied to is at

    div.product_image a.thickbox img

    I am a JS newbie so I would like some help!

    Thanks!
    • CommentAuthoroeb
    • CommentTime7 days ago
     
    Take a look at jquery http://www.jquery.com

    The following code should do this
    $(document).ready(function() {
    $("div.product_image a.thickbox img").addClass("classname");
    });

    That should do it for you. (Replace classname with the class you want applied.
  2.  
    WOW! AMAZING! Thank you so much! Fortunately I already needed jQuery for my site so I didn't have to tack on a massive library just for this! Thanks!