Make ThickBox Work with Other JavaScript Libraries / Resolve ThickBox Conflict Issues

13

Category : JavaScript, jquery, Open source, PHP, Software development

ThickBox is a cool visualization tool based on Jquery JavaScript library. ThickBox helps you display photos in a cool way and is useful in many web projects.

The problem

ThickBox does not work when the HTML pages has other JavaScript libraries such as Mootools.

Debuging the error reveals this:

$(domChunk) is null

The solution

  1. Add this JavaScript in your page, just after you load the jQuery JavaScript-jQuery.noConflict();
  2. Replace every instances of ‘$’ with ‘jQuery’ in thickbox.js

This will make jQuery and ThinkBox play nice with other JavaScript libraries.

Comments (13)

Thank You very much!! This is exactly what I needed :)
Thickbox with prototype and jquery same time…

Excellent !!! Good news for this morning :)
Greetings from France !!

Hi.
Have an asp:UpdatePanel
And when that is fired Thicbox don’t work anymore.
Tried the soluton mentioned abow, but no luck :(

this is exactly what i needed i have thickbox integrated in a project and i try to add an other lightbox plugin for the same page like a photo gallery but the two plugins was making a conflict i think because the two plugins have similar funcion names but if i add this chunk of code all works just as i expected.

Very useful article. I was having throuble to start putting thickbox to work.

I just spend four hours. Worked first time.

This is Good Post…

my problem has solved by your post…

thanks….

God I love random blogging posts. Just saved me a load of time :-)

Thanks! Going to bed sooner!

Worked like charm. Thanks.

It really saved my time. Thanks a lot Amir!

Awesome..!
If only I found this page earlier!

Thanks Amir

Yes, thank you very very much, I was thinking of jumping of a building because i couldn’t solve this one!!!! Greetings from the Netherlands!

Post a comment