Not too involved, but a little bit, that's why I asked:

Originally Posted by
myself
. . . do you intend for all of your pop-ups to be the same size?
You need to have a way to pass the individual dimensions to it. For that, I think the best way would be to go back to and expand our 'bigpictures' array (additions red for first entry, observe the expanded syntax for all entries, as shown):
Code:
var bigpictures=new Array();
bigpictures[0]=["photo_huge1.jpg", 200, 200]
bigpictures[1]=["photo_huge2.jpg", 300, 250]
bigpictures[2]=["photo_huge3.jpg", 250, 250]
bigpictures[3]=["photo_huge4.jpg", 400, 450]
bigpictures[4]=["photo_huge5.jpg", 350, 200]
bigpictures[5]=["photo_huge6.jpg", 150, 225]
bigpictures[6]=["photo_huge7.jpg", 345, 500]
bigpictures[7]=["photo_huge8.jpg", 600, 400]
bigpictures[8]=["photo_huge9.jpg", 250, 100]
The added numbers are the width and height, respectively. Now our function could be:
Code:
function openDa(im, w, h){
LeftP = (screen.width) ? (screen.width-w)/2 : 200;
TopP = (screen.height) ? (screen.height-h)/2 : 200;
var win=window.open('','gal','width='+w+', height='+h+', top='+TopP+', left='+LeftP);
win.document.write('<body style="margin:0;padding:0;margin-top:5px;text-align:center;">');
win.document.write('<a href="javascript:self.close();"><img src="'+im+'" border="0"><\/a>');
win.document.close();
win.focus();
}
We would also need to change this bit (additions red):
Code:
var theImage=bigpictures[0][0];
var theW=bigpictures[0][1];
var theH=bigpictures[0][2];
function loadImage(id, num){
if(document.getElementById(id).filters)
document.getElementById(id).filters[0].Apply();
document.getElementById(id).src=dynimages[num]
if(document.getElementById(id).filters)
document.getElementById(id).filters[0].Play();
theImage=bigpictures[num][0];
theW=bigpictures[num][1];
theH=bigpictures[num][2];
return false;
}
And, finally the call in the markup:
Code:
<a href="javascript:void(0);" onclick="openDa(theImage, theW, theH);return false;"><img id="loadarea" src="photo1.jpg" width="140" height="225" border="0"></a>
Bookmarks