Thickbox and jQuery 1.3.1

I've recently been finishing off a site where I needed a lightbox to simplify showing several photos for each product. I've used Thickbox in the past, as it comes with WordPress by default, however this is a custom built site. I already had the latest version of jQuery running for other functions on the site, so just needed to grab a copy of thickbox, upload that, add the necessary code and that should be that.

3 hours of going around in circles later… and still no joy! After checking over my code piece by piece, trying the code out of WordPress, trying the page on another server just in case, and trying every other option I could think of, I finally tried uploading jQuery 1.2.6 from my WordPress 2.7 folder on my computer, and hey presto, it all worked!

It seems that there is a minor change required for thickbox to work with the latest jQuery version. After a bit of searching around I found out that what's needed is on line 79 of the existing thickbox file you need to change the line

Existing Thickbox Code
  1. TB_TempArray = $("a[@rel="+imageGroup+"]").get();

to not include the @ sign in it ie.

New Thickbox Code
  1. TB_TempArray = $("a[rel="+imageGroup+"]").get();

Such a simple change that caused a few hours of frustration! So hopefully it may be of use to someone else :)

You may also like...

84 Responses

  1. laura says:

    this is awesome! so glad i found your fix. THANK YOU SO MUCH for posting!!!!!!!!

  2. Molotok says:

    Thanks a lot. Half a day lost, but another half saved…

  3. Keenora says:

    Awesome! You helped me alot with this tiny change :3

  4. julie says:

    thank you so much! i've been looking everywhere for a solution! so so simple!

  5. wouter says:

    Has anyone an idea to solve this in the minimized version?

  6. Adam says:

    Thank you so much this saved me from a headache!

  7. Jon says:


  8. Karl says:

    Great stuff, saved me a lot of hassle.

  9. David says:

    Thank you for this it saved me a lot of time.

  10. Martin_X says:

    Thank You

  11. karl says:

    I agree with everybody wasted hours trying to get it working with opencart, fixed in mins.

    Thankyou thankyou thankyou

  12. Wies says:

    OMG what a find …. thanks so much!

  13. Fletch says:

    Thanks Sarah.

    You're the tops!

  14. girish says:

    Nice fix……Thanks a lot……

  15. Martin says:

    Thank you. Saved me hours of digging. Nice Post!

  16. Rafael says:

    Thank you! Helped a lot here at work!!!

  17. or says:

    Thanks!!! Very helpful!!

  18. mati says:

    yeah!!!! remove the only @ in the compressed version, and get it working!!!


  19. Satheesh says:

    Thanks a lot

  20. Oh yes says:

    Oh oui c'est bon ça !!
    Thank you very much for this.

  1. Thu, 28 May, 2009

    […] dar a ap?rut o alt? problem?: Thickbox nu func?iona pentru un set de poze. Am g?sit problema aici ?i anume modificarea liniei 79 din fi?ierul thickbox.js […]

  2. Fri, 24 July, 2009

    […] you to Stuff by Sarah for finding the following fix: It seems that there is a minor change required for thickbox to work […]

  3. Fri, 17 December, 2010

    […] Fix The Rel Tag On Thickbox This entry was posted in link. Bookmark the permalink. ← Basic Economic Thoughts Build It […]

  4. Mon, 22 August, 2011

    […] my wife for dealing with this issue, HT to Websites in a Flash where the solution was found, HT to Stuff by Sarah where the original solution was found), but it bears repeating […]

  5. Tue, 7 February, 2012

    […] Thickbox & jQuery REL issues /* […]

  6. Mon, 29 October, 2012

    […] This blog post outlines the exact line of code in the thickbox .js that you need to alter: … query-131/ […]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>