Archive

Archive for the ‘Javascript’ Category

Thickbox: reinitialize Thickbox after change by Ajax

March 31st, 2009

Hi,

Thickbox is a very nice javascript library based on jQuery (which is also a very neat library). It is used to show images and documents in a sort of popup like Lightbox does.

Let me sketch the problem:

1) I load my page (also loading thickbox.js)
2) I change my content in one dom-element, for example a div element, through Ajax.
3) Then I want to call thickbox on an element in the new div.

You will that see nothing happens, because Thickbox hasn’t been able to register this object.

So basically we need to reinitialize Thickbox.
Read more…

ruben Ajax, Javascript ,