jQuery thickbox gallary image loading problem

In my past post I discussed about a problem of thickbox while working with ajax content. Today I’ll show you another problem in which people always fall while using jquery thickbox and then if they don’t get any suitable solution go for alternative which are available šŸ™‚ The problem is sometime (most of the case) while thickbox is used for showing image gallary with “rel” attribute in the link the images would not load. I also fell in the problem and the image was not loading while I use the rel attribute for showing image gallery and even I wanted to go for lightbox which is cool also. But then I found the issue. I’ll show you the issue bellow:

All you need to open the thickbox.js file and need to edit.

At the line 79 you have the following code

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

You need to edit it to :

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

And now use rel attribute and see it should work.

<a href="images/image1.jpg" title="My title 1" class="thickbox" rel="gallery-image"><img src="images/image2_thumb.jpg" alt="Image 1" /></a>
<a href="images/image2.jpg" title="My title 2" class="thickbox" rel="gallery-image"><img src="images/image2_thumb.jpg" alt="Image 2" /></a>
<a href="images/image3.jpg" title="My title 3" class="thickbox" rel="gallery-image"><img src="images/image3_thumb.jpg" alt="Image 3" /></a>
<a href="images/image4.jpg" title="My title 4" class="thickbox" rel="gallery-image"><img src="images/image4_thumb.jpg" alt="Image 4" /></a>

Have a nice time !

Advertisements

, , ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: