views:

346

answers:

3

Hi All, I am using jQuery thickBox to make use of the light box effect n my page.Some times i load the content of one of my DIV using jQuery's load method.At that time the thick box didnt worked so I called the initialization function (I put that in another function called PreLoad() and invoiked it )available in thickbox.js before i load the content to div

$(document).ready(function(){   
tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
imgLoader = new Image();// preload image
imgLoader.src = tb_pathToImage;
});

So thereafter my lightbox worked fine.I wanted to call the PreLoad() function when i load the content again and again.Now if i call the PreLoad function 4 times,I am getting 4 Title bars in my light box. no Idea how to go ahead. Any Thoughts ?? Thanks in advance

A: 

You need to add a call to "tb_remove();" into your interaction pattern. That should cleanly dismount a thickbox instance.

Just add "tb_remove();" to the top of your PreLoad() function.

John
A: 

Or add

$("#TB_window").html("");

somewhere at the top of tb_show function in the thickbox.js file.

ovnis
A: 

Thank u ovnis.It did work.

Codejack