Today was my first time using Thickbox, and I’m pretty satisfied. It’s got all the features I was looking for, namely “pop-in” images, iframes and galleries.
I didn’t really like how you had to add a querystring for the Thickbox iframes (I would prefer to use the rel attribute), but it still works fine.
Gallery Images Not Working
I’ve been banging my head against the keyboard for hours trying to fix this one little bug with Thickbox. For some reason, when I used the Thickbox Image Gallery, I couldn’t get the image to appear at all!
The Thickbox Image Gallery is where you open up one image in a gallery and then you can click “next” and “previous” to see the other images in the gallery. Thickbox uses the “rel” attribute for this, but for some reason, adding the “rel” attribute completely breaks it. When you click on the image, it starts the loading image… but doesn’t go anywhere. It just sits there with the loading image displayed.
Thank you to Stuff by Sarah for finding the following fix:
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
- TB_TempArray = $(”a[@rel="+imageGroup+"]“).get();
to not include the @ sign in it ie.
- New Thickbox Code
- 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
Compressed Thickbox fix
I happened to have the compressed version, but was still able to find the Gallery fix myself. You can replace:
- Existing Thickbox (Broken) Code
- {E=$(”a[@1N="+g+"]
to not include the @ sign in it:
- New Thickbox Code
- {E=$(”a[1N="+g+"]
And that’s it. I was definitely glad to find a solution, I hope this helps you too.
Ashton Sanders







Sweet. Thank you.
Comment by Michael Hessling — August 10, 2009 @ 2:56 pm
You’re welcome. Glad it helped.
Comment by Ashton Sanders — August 10, 2009 @ 3:31 pm
Thanks for clearing the trail for the rest of us!
A note: I think the broken and fixed code for the compressed version in your post are identical. Error?
Comment by Zachary Williams — August 19, 2009 @ 2:35 pm
Haha, Thanks Zach. Good catch.
You’re more than welcome.
Comment by Ashton Sanders — August 19, 2009 @ 4:46 pm
Its the current release and its sad get stuck with this problem. Thanks to you!
Comment by Marvin — August 26, 2009 @ 1:15 am
Woot! Thanks, this saved me a LOT of time
Comment by BM5k — August 27, 2009 @ 2:36 am
Huge… thanks.
Comment by ATLPHP — September 4, 2009 @ 12:13 pm
holy crap i love the internet.
One bloody @ was making me lose my mind.
Thanks a ton!
teh kiddies thank you too
Comment by Casey Driscoll — September 7, 2009 @ 4:43 pm
Nice! Thank you so much!
Comment by Justin — September 9, 2009 @ 2:03 pm
<3 hero !
Comment by romenov — October 2, 2009 @ 4:19 am
Thank you! I was sure I had the code correctly; thanks for the solution.
Comment by Kevin — October 8, 2009 @ 12:31 pm
This issue seems to stem from using the newest version of jQuery. If you look at the thickbox website it is using jquery-1.1.3.1.pack.js.
Nice working on finding that @!
Comment by justin — October 8, 2009 @ 4:53 pm
Thankyou!! thankyou!! thankyou!! I told my client it would be no problem to do and was beginning to get worried
Your the Best!!!!
Comment by lukdvr — December 9, 2009 @ 3:32 pm
Thanks very much, this saved alot of time! Appreciate your post. How did you figure it out? its always good to know what the cause is.
Comment by Elemental - South Africa Web Development — December 15, 2009 @ 4:12 am
Great stuff! thanks so much for this assistance, we been struggling to find a solution for ages
Comment by Wapit Mobile Search Engine — December 15, 2009 @ 4:13 am
My goodness.
I have been stressing out over this for weeks why my gallery worked at first, and stopped functioning when I insterted a textarea thickbox.
After almost losing sanity, I find that is just this small @ sign that has been pestering me.
Thanks a 100 times for this one, you saved my work.
I guess it’s not this specific day for nothing;
Merry Christmass!
Comment by Kris — December 25, 2009 @ 5:22 am
Thank you so much – cannot thank you enough for printing this on your site. I’m doing this for a client and I thought I was going to have to start all over with another slide show.
Happy New Year!
Hope
Comment by Hope — December 29, 2009 @ 12:29 pm
Oh my, this is awesome! Thanks so much! I was pulling my hair out on this one and now you’ve resolved it!!
Comment by Ian Pitts — January 7, 2010 @ 9:58 am
[...] Dank an die Jungs, die es rausgefunden [...]
Pingback by Silberlinge – Das Docdata-Blog » jQuery Thickbox: Galerie-Bilder laden nicht — February 8, 2010 @ 10:47 am
OMG … this stupid bug waste me hours … thank you so much for publishing!!
Comment by Rosch — February 14, 2010 @ 6:07 pm
Thx alot man…. i owe u one!
Comment by Bob — March 5, 2010 @ 6:50 am
THANKS!
Comment by Dustin — March 24, 2010 @ 10:35 am
Oh my, this is awesome! Thanks so much! I was pulling my hair out on this one and now you’ve resolved it!!
Comment by Bruce — May 19, 2010 @ 9:49 am
thanks a lot…
Comment by makkal — July 26, 2010 @ 2:48 pm