PDA

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



cogancorp
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!
Gary

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

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


<SCRIPT LANGUAGE = JAVASCRIPT>
if (document.images)
{
img1 = new Image();
img2 = new Image();
img1.src = "imageName1.jpg";
img2.src = "imageName2.jpg"
}
</SCRIPT>


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:
http://www.netmechanic.com/news/vol3/loadtime_no6.htm
http://www.javascriptkit.com/script/script2/preloadimage.shtml
http://www.hypergurl.com/generators/preloadimages.html
http://www.ilovejackdaniels.com/css/preloading-images-with-css/

See if it helps ;)

jscheuer1
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">
</div>

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.