24 August 2009

I have seen many times that Thickbox normal works with <a href=””></a> syntax,

Ex :

Inner Page Content Syntex :

<a href="#TB_inline?height=200&width=200&inlineId=hiddenModalContentID&modal=true"
class="thickbox">Click here to show hidden modal content.</a>

IFrame Syntex :


<a href="testPage.aspx?keepThis=false&TB_iframe=true&height=200&width=200"
title="saActionPage" class="thickbox">Click here</a>  

But what happen when you need to open ThickBox by click event? Here is its solution.


You can to use same syntax of HREF  with “tb_show” function.


Ex :


<script language="javascript" type="text/javascript">

    function showTB()  {

       var newURL = "#TB_inline?height=200&width=300&inlineId=hiddenModalContentID";

        tb_show("ThickBox Title Here", newURL);

    }

</script>


It means you can also open thick box by any other event also.

1 comment :