PDA

View Full Version : I want to have a small pic to click on that will..


becky gelke
12-09-2005, 04:30 AM
Hi again, I am trying desparately to problem solve myself, but this I cant do, simple as that. I am doing a small site that I would like to showcase some pictures/photos in. I would like to say have a 4 x 4 grid of small pics, and each one I click on I would like to open within the same page (perhaps on the right of the screen, with the thumbnails on the left) I know how to do it in a separate window, but dont really want to do it that way.

Also is there some way of preloading these images, so every time I click a thumbnail, the image will load straight away, without the dreaded waiting time.

Thanks for your efforts if any of you are able to help.

davidj
12-09-2005, 10:00 AM
if you know how to do this in a seperate window then you you know you are using target = _blank

instead call the page using target = _self

to preload images try this function

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

then in your body tag set this..

<body onload="MM_preloadImages('images/04-cupra-badge2.jpg','images/04-cupra-badge.jpg')">
where 'images/04-cupra-badge.jpg' is the path and image that you want to preload (delimited by a comma)
example....

<body onload="MM_preloadImages('images/image1.jpg','images/image2.jpg','images/image3.jpg','images/image4.jpg')">

becky gelke
12-09-2005, 10:58 AM
Thank you David, I will give it a go, what I actually forgot to mention was I was thinking of splitting the middle part of the page into two frames (basically the same size as each other, and sitting side by side) so I wanted the pics to open in a new frame (which I know how to do) just wasnt sure how to preload them in that scenario.

davidj
12-09-2005, 11:02 AM
just preload them in any page that you call within the frameset