preloading images...

R

riki

hello,
i found this script on the internet (i simplified it a little) and i have
two questions:

<script language=javascript>
var preloadimages=new
Array("pic1.jpg","pic2.jpg","pic3.jpg","pic4.jpg","pic5.jpg"...etc);
var theimages=new Array();

for (p=0;p<preloadimages.length;p++){
theimages[p]=new Image();
theimages[p].src="/html/images/"+preloadimages[p];}
</script>

Q1: i want to use preloading for images that opens in popUp window. when i
click on the little thumb, larger pic opens in the popUp and i would like to
preload this larger pic. is it posible or does it use only for rollover
pics, i mean pics that open on the same page (not in popUp)?

Q2: if i previously used link on main page i.e.
window.open('/html/images/pic1.jpg','','properties'), should i change that
whit this one window.open('/html/images/theimages[p].src','','properties')
or would it work like it was? i mean should i change names of the pics
"pic1.jpg","pic2.jpg","pic3.jpg","pic4.jpg","pic5.jpg"...etc with preloaded
array "theimages[0].src","theimages[1].src","theimages[2].src",...etc.
thank you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top