[thelist] js popup images

Adam adam at hallinteractive.com
Mon Apr 22 09:13:00 CDT 2002


hey thx for all of your help!
here is what I've got thus far...

<js>
var newWindow = new Object();
newWindow = null;

function subWin(url,wdth,hght){
   var screenTop = (screen.height / 2) - (hght / 2);
   var screenLeft = (screen.width / 2) - (wdth / 2);
   if (newWindow && !newWindow.closed) {
        newWindow.close();
   }

newWindow =
window.open(url,'newWin','width='+wdth+',height='+hght+',top='+screenTop+',l
eft='+screenLeft+',screenY='+screenTop+'
screenX='+screenLeft+',status=no,scrollbars=no,resizable=no');

newWindow = document.write('<html>'+
'<head>'+
'<title>Larger Image</title>'+
'<style type="text/css">'+
'body {margin: 0px; top:0px; left:0px; }'+
'</style>'+
'</head>'+
'<body>'+
'(url)'+
'</body>'+
'</html>');

   if(!newWindow.opener) {
        newWindow.opener = self;
   }
   newWindow.focus();
}
</js>

and the call

<a href="large/divertervalves_f.jpg" onclick="subWin(this.href, 342, 244);
return false;" title="Larger Picture">

this script allows me to set the window dimensions according to the picture
size as I include them- so I need to keep this. I think it's the (url) bit
thats tripping up the script....

any thoughts?





More information about the thelist mailing list