Close thickbox and the open it again

Dofs picture Dofs · Mar 24, 2009 · Viewed 16k times · Source

I am trying to do kind of a wizard using thickbox, and it works fine when opening it the first time. When I click next I would like to close the div I have opened and open a new one in thickbox, but how is it done? I have tried the following code, but it just closes the thickbox and doesn't open it again:

tb_show("", "#TB_inline?height=280&width=620&inlineId=divStart", "");
tb_remove();
tb_show("", "#TB_inline?height=280&width=620&inlineId=divContinue", "");

Answer

user136636 picture user136636 · Jul 11, 2009

You can use this code:

//dont use tb_remove() function

$("#TB_window").remove();
$("body").append("<div id='TB_window'></div>");
tb_show("", "#TB_inline?height=280&width=620&inlineId=divContinue", "");

If you use iframe for loading content:

var p = parent;
p.$("#TB_window").remove();
p.$("body").append("<div id='TB_window'></div>");
p.tb_show("", "#TB_inline?height=280&width=620&inlineId=divContinue", "");