View Full Version : Pre Load Image in Image Thumbnail Viewer II

03-15-2008, 02:11 AM
Hi Everyone,

I have installed Image Thumbnail Viewer II and it works perfectly. Does anyone know how to have one of the enlarged images preloaded (without the mouse over or click) when the web page is loaded? So, when the page is loaded all the thumbnails and one enlarged image will be displayed.

Thank you in advance!

ps. Thank you for the great scripts Dynamic Drive. All your hard work is greatly appreciated!:)

03-15-2008, 02:28 AM
In js, you can do it with:

if (document.images)
img1 = new Image();
img2 = new Image();
img1.src = "imageName1.jpg";
img2.src = "imageName2.jpg"

You could also do it with CSS. You let all your images load first. (http://www.netmechanic.com/news/vol6/css_no18.htm)

You may also find this links useful:

See if it helps ;)

03-15-2008, 04:40 AM
I think you mean have an image in the 'loadarea' when the page loads. If so, just hard code it:

<div id="loadarea" style="width: 500px">
<img src="whatever.jpg">

In fact, you can put any HTML you like in there, image(s), linked image(s), link(s), text, etc. Anything that you put in there will be overwritten once the user activates the script, but until then, it will act as a placeholder - something to look at until the user starts clicking on or mousing over the triggers for the script.