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. Thanks, exactly what I was looking for!

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

    Any ideas?

  3. Oops, sorry – my mistake, it does work!!

  4. 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.

  5. 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…

  6. Thank YOU Thank YOU Thank YOU! this made it so easy!

  7. 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.

Twitter
LinkedIn
YouTube
Instagram