Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying preloaded images

Status
Not open for further replies.

dasnani

Programmer
Sep 2, 2004
7
US
I have a small problem with JavaScript. Does anyone have a sample script with you which just displays preloaded images.
I have a JSP and I have tags like this:
<img src=&quot;/schedule/images/but1.gif&quot; height=&quot;5&quot; width=&quot;5&quot;>

The page loads a little slowly due to the 10-15 small images on it and I decided to preload them.
On the internet I found many examples to change images with mouseOver events, but none to just simply display preloaded images.
Can you send me any such example??

Thanks.
 
Hi,

If you want to preload your images.... Use Dreamweaver-it will code by itself go to Behaviors, click the + sign and locate Preload Images then click browse to locate your first image, Click + to add another image and - to erase...

Hope to help.
 
u can try something like this.
preload the images in the head section as usual.
example,
Image im = new Image(30,30);
im.src = &quot;file.gif&quot;

after this, to display the image, try this
document.write(&quot;<img src=&quot;+im.src+&quot;>&quot;)

this should display the preloaded image. hope it works.

luv
Karthik.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top