ThickBox 3.1 Gallery Images Bug Fix
If you has used ThickBox 3.1 (jQuery Plugin), you might have been immediately disappointed by a perplexing bug in it’s gallery images functionality. When following the instructions on the site, it seems so easy. Almost too easy. When you test your image gallery in a browser, this annoying bug rears it’s menacing head and takes the form of a never ending progress bar. No images are loaded. That’s not how a gallery should be!
But wait! Don’t give up yet!
The solution is simple. After looking in all the wrong places for a mistake I didn’t make, I found a topic on the secret ThickBox Forum with a brilliant comment from a fellow called “hanes”.
The problem
The problem lies in the jQuery version you are using. At the time of this writing there was no mention of any jQuery version requirements. ThickBox 3.1 was written on a version of jQuery earlier than 1.3, which causes problems when you use the latest version. jQuery 1.3 has a slightly different syntax for the selector used in ThickBox.
So what do you do?
If you didn’t click the link to the brilliant comment, all you need to do is change one dinky line of code, nay, one character in thickbox.js.
Change line 79-ish from this:
TB_TempArray = $("a[@rel="+imageGroup+"]").get();
to this:
TB_TempArray = $("a[rel="+imageGroup+"]").get();
September 6th, 2009 on 4:03 am
Great Thanks for that ! This one was beginning to drive me crazy…
September 30th, 2009 on 11:19 pm
very thanks. i spent nearly 1 day to identify the issue.