Ninetynine is a creative design & coding agency

Archive for the ‘Javascript’ Category

Thickbox: reinitialize Thickbox after change by Ajax

with 10 comments

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 the rest of this entry »

Written by ruben

March 31st, 2009 at 4:08 pm

Posted in Ajax,Javascript

Tagged with ,