I came to this answer page, and tried the solution proposed here. It did not work. I used one of my old tricks, and like almost everytime, it worked. Although this post is more than 3 years old, I wanted to share the trick. The trick is to use window.setTimeout to delay the call to the next tb_show().
window.setTimeout(function(){
tb_show("", "#TB_inline?height=300&width=300&inlineId=confirmDiv&modal=true");
$("#TB_window").css({'border':'0px', 'background':'none'});
},300);
Please also note two other tricks I have used:
I wanted to show a modal popup.The HTML was in a div with id "confirmDiv". But it was showing the usual thickbox with title and padding. So the second line removes the border and background color from TB_Window, which shows only the popup HTML.
I also used a general height width of 300px, although my popup was only 250px. This will prevent the scrollbars even if the content is a little bigger. The TB_Window is not showing anyway, so it won't matter.
Hope this helps somebody.