Snippets

Display thickbox on page load

By default, jQuery thickbox plugin displays a thickbox overlay window when you click on a link which class is set to thickbox. The following code lets you display thickbox on page load without hacking anything in thickbox code.

<script type="text/javascript">
$(document).ready(function(){
tb_show("Announcement","announcement.html?height=300&width=300", "");
});
</script>

Recommended Books on jQuery

8 thoughts on “Display thickbox on page load

  1. This only displays a blank white thickbox with a title, my test.html page isn’t displaying.

    Any ideas?

  2. My test page isn’t displaying the ESC /hit close and also got a blank page. How did you fix this? Can you post your solution. Thanks.

  3. I was wandering if there was a way to have this javascript do some other things…

    1:) Set a Cookie that (reopen next visit, do not allow ever, allow if a file has been updated on the server directory since last visit) and lasts 30-90 days (perhaps

    2:) Checks if a file (announcements.html) has been updated (since last site access) and opens it up in a thickbox if it has a newer date since the last visit…

  4. Man I have been looking for this forever. No idea why it took so long to find. It seemed like a simple thing to me just couldn’t figure it out. Thanks a ton.

Comments are closed.

Career Guide for Software Developers