Function in the first frame of the root
[AS]function popup(number,picwidth,pichieght){
getURL(“javascript:var mypopup = window.open(‘gallery/’+number+’.htm’,‘mySite’,‘toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=‘picwidth’,height=‘pichieght’,top=’+eval((screen.availHeight - ‘pichieght’) / 3)+’,left=’+eval((screen.availWidth - ‘picwidth’) / 2));mypopup.focus();”);
}[/AS]
I have done something like this before. What I did was used JavaScript in the external page
Something like this…
<SCRIPT LANGUAGE="JavaScript">
<!--
function resize(w, h){
var imgW = document.galleryImage.width;
var imgH = document.galleryImage.height;
var centerWidth = (screen.width) ? (screen.width-imgW)/2 : 0;
var centerHeight = (screen.height) ? (screen.height-imgH)/2 : 0;
window.resizeTo(imgW, imgH);
window.moveTo(centerWidth, centerHeight);
}
-->
</SCRIPT>
That would be your function, and it would be called onLoad of the page…
<BODY ONLOAD="resize()">
And the image would have to be named “galleryImage” (unless changed in the script)…
<IMG SRC="image.jpg" NAME="galleryImage">
Now of course if you have seperate pages for each image, that will be hassle to add into each page. And that is why for mine I put it in a PHP page, sent the URL to the image via a query string and pull that info in to load the image…
Oh yeah, and note the javascript code repositions the window, I did this because when I used it the window was centered, and changing the window size after it is already centered makes it not so centered.
Creating engaging and entertaining content for designers and developers since 1998.