Thickbox 3.1 and jQuery - problem with rel

Update: Thickbox is yesterdays lunch... Colorbox is tomorrows high-tea!  Check it out... I'm in the process of porting most of the sites I look after over to use this new module.  No more compatability problems, it just works... and it looks great.

http://drupal.org/project/colorbox

 

 

 

Original story:

Thickbox has always worked well for me.  Its simple, effective and classy.  But recently while coding a new site I had problems trying to get image galleries to function.  Thickbox would work fine until the rel parameter was added, then it would just sit there with the loading gif showing over and over... but no image (similar to what happens if you link to an image that doesn't exist, or you use the wrong path to the main image, etc).

rel is a simple thing in Thickbox, you just add rel="galleryName" inside your code, where galleryName is the name you want to group those particular photos with - ie:

   <a href="/images/theImage.jpg" title="The Image" class="thickbox" rel="galleryName"></a>

All images with the same rel tag will be shown in sequence using the next / last links in the popup.

Anyway, what I found after a lot of searching is a solution (thanks to http://www.stuffbysarah.net ) that is as simple as it is annoying.  Simply locate line 79 of the code, and remove the '@' from the line, as follows, and it bursts back into life.

old line:

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

change it to:

   
TB_TempArray = $("a[rel="+imageGroup+"]").get();

 

Oh - and if you use the compressed version, then search for this:

   
{E=$(”a[@1N="+g+"]

and change it to: (ie, just remove the @)

   
{E=$(”a[1N="+g+"]

Hope that helps someone... Cool

it is an excellent tutorial

it is an excellent tutorial specially galleryName part was very informative one

Blessings

Your Sir are a gem of a geezer! Well spotted and thanks for taking the time to share.

Awesome

Thanks!!!!!

Praise the lord

Hey man. That was just the thing I needed. Thanx a lot. Was just upgrading jQuery and thickbox did not work anymore. Your tip is worth a pound of gold.

thank you!

thank you!

thanks

Thank-you !

And why don't they mention o change this on the thickbox site ?!

Yes I know it's no longer supported but as long as people are downloading it.. you know ?

Yep, I wish they had... it

Yep, I wish they had... it would have saved me a lot of headaches... but at least colorbox works... also the Highslide module for Drupal looks quite good too.

Thanks! You save my life 

Thanks! You save my life Cool

Nicely spotted

Good of you to share that.. I was having a mare trying to work out what was breaking it..

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <drupal6>, <html>, <java>, <javascript>, <php>, <python>. The supported tag styles are: <foo>, [foo], [[foo]].
  • Syntax highlight code surrounded by the <pre class="brush: lang">...</pre> tags, where lang is one of the following language brushes: bash, css, jscript, java, php, python.

More information about formatting options

CAPTCHA
This question is to prevent automated spam submissions. Upper or lower case does not matter. If you can't read it properly, just submit what you believe it says and if its wrong you will be presented with a new captcha image.
Image CAPTCHA
Enter the characters shown in the image.