Thickbox onLoad popup

I’m looking to make a Thickbox popup whenever a user loads a page. Any suggestions on how to do this are greatly appreciated.


window.onload=function(){TB_show("Google", "", false);}

or read:

Hi spikeZ,
Thanks for the quick reply!

I have tried that code but maybe I am unaware of where to put it?

I have also read that article before but still can’t seem to get it working. (Nor can I seem to find a demo of it in action anywhere)


Hi Richard,

Here is a quick example using the jQuery $() code rather than window.onload.
I have 2 images in the same folder as the page: Creek.jpg and Forest.jpg

Forest will load when the window loads and Creek onClick.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">

	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
	<meta name="author" content="">

	<title>Thickbox - onLoad</title>
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="thickbox.js"></script>
	<link rel="stylesheet" href="thickbox.css" type="text/css" media="screen" />
	tb_show("Forest Pic","Forest.jpg",false);

<p>To show onClick:</p>
<a href="Creek.jpg" class="thickbox" ><img src="Creek.jpg"></a>



Copy and paste and make sure your paths are correct :slight_smile: