[thelist] js popup images

Guy Upfold guy at upfold.co.za
Mon Apr 22 12:32:01 CDT 2002


----- Original Message -----
From: "Adam" <adam at hallinteractive.com>
To: <thelist at lists.evolt.org>
Sent: Monday, April 22, 2002 4:12 PM
Subject: Re: [thelist] js popup images

Paul Sowden  and Aaron Boodman ( www.idontsmoke.co.uk and www.youngpup.net)
made a really great script for this thing, its called imagepop.js, I would
try that, it generates a valid html 4 page as well with alt tags and title.


> 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