I have the following code for popup window written in javascript :
<SCRIPT type="text/javascript">
function popUp(URL, WID, HIG)
{
window.open(URL, "picture",
'toolbar=0,scrollbars=,location=0,statusbar=0,menubar=0,resizable=0,width=WI
D,height=HIG,top=0,left=0');
}
</SCRIPT>
-------------php---code------
<?php
.....
$pic_property = getimagesize($PicPath);
$width=&$pic_property[0];
$height=&$pic_property[1];
.......
<img src="$PicPath" border="0" onClick="popUp('$PicPath', '$width',
'$height')"></img>
.....
?>
The problem is that when I click on the picture pic is displayed but in
large window (maximum size)
I just can't get it to open using picture's width and height???
Any suggestions???
respect
point
> window.open(URL, "picture",
>'toolbar=0,scrollbars=,location=0,statusbar=0,menubar=0,resizable=0,width=WI
>D,height=HIG,top=0,left=0');
Not perfect but better..
window.open(URL,'picture','width=' + WID +', height=' + HIG +',
location=no, menubar=no, status=no, toolbar=no, scrollbars=no,
resizable=no');
--
Geoff Berrow
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
If the window isn't open to begin with, then the JS code you have should
open it to the correct width and height for the picture (whatever you
passed in anyway)
If the window is already open though, opening it again will *NOT* resize
the window. You will need to do that on it's own using
win.resizeTo(width, height)
<SCRIPT type="text/javascript">
function popUp(URL, WID, HIG)
{
var win=window.open(URL, "picture",
'toolbar=0,scrollbars=,location=0,statusbar=0,menubar=0,resizable=0,width=WI
D,height=HIG,top=0,left=0');
win.resizeTo(WID, HIG);
}
</SCRIPT>
Also, since the width and height are numbers, you don't need to put
quotes around them when you call the function from the image (though it
shouldn't hurt any, but it may)
<img src="$PicPath" border="0" onClick="popUp('$PicPath', $width,
$height)" />
Hope that helps
--
http://kicken.mine.nu:8008/ - Personal Site
http://wiser.kicks-ass.org:8008/ - Long-term Project
Keith Maika
Oops, didn't notice that slight error in the JS (though the resize
probably would have fixed it) but you need to exit the string to insert
variables into it.
var win=window.open(URL, "picture",
'toolbar=0,scrollbars=,location=0,statusbar=0,menubar=0,resizable=0,width='+
WID +',height='+ HIG +',top=0,left=0')
it helped...
respect...
p.
"Geoff Berrow" <$b...@ckdog.co.uk> wrote in message
news:r1o7dvo8pnsdpuctv...@4ax.com...