Rodrigo Moraes wrote:

Hi,
I have a problem with Thickbox contents not being loaded when the
trigger is set dynamically. Here's an example:

  http://dev.tipos.com.br/jquery/thickbox.php

1. Click on 'add a new thickbox trigger'.
2. Click on the new link to open the ThickBox. It will open and the
content will be set normally.
3. Repeat step 1. The new link will open a Thickbox which is empty.

Any clues why this is happening?

thanks,
rodrigo


Rodrigo, it's inline content, right?

What currently happens is this: When opening the Thickbox this content gets captured in a closure and never gets reappended back to its original location - it is appended to the modal with appendTo, e.g. it is moved in the DOM. But when the modal gets closed it is emptied without restoring the content to its origin.

If you then add another Thickbox handler which refers to the same content, this content is already empty if you've opened the Thickbox with that content before from another handler.

I don't want to clone the content, because I want to preserve existing event handlers. I didn't restore the content, because (until now) it worked the way it is, so I was fine with it. I have never thought about the case you're talking of, so I will have to think of a way to solve this.

I guess I need to restore the content when closing the Thickbox...


-- Klaus

Reply via email to