Launch Thickbox onload Instead Of click

user71723 picture user71723 · Nov 26, 2009 · Viewed 17.7k times · Source

I want to launch a jquery thickbox onload instead of click. for this I use the code below.

<script language="javascript">
    tb_show("HAI","#TB_inline?height=240&amp;width=405&amp;inlineId=hiddenModalContent&amp;modal=true",null);
</script>

Actual link is

<a href="#TB_inline?height=240&amp;width=405&amp;inlineId=hiddenModalContent&
amp;modal=true" class="thickbox">Change Name</a>

When I click the above link..thick box appears..

but on body onload thick box is not appearing..

Please help regarding this..

Thanks in advance...

regards Yen

Answer

Matt Frear picture Matt Frear · Jan 24, 2010

Your code should work. Maybe try putting it in a call to jQuery's document.ready e.g.

<script language="javascript">
    $(document).ready(function() {
        tb_show("HAI","#TB_inline?height=240&amp;width=405&amp;inlineId=hiddenModalContent&amp;modal=true",null);
    });
</script>