i have a link which opens a image in a new window. what i want it to do is to have the window be sized 30 pixels bigger than the picture. the code i have got is this
[tt]function openPic(pic) {
var Ihight, Iwidth;
BaseImg = new Image;
BaseImg.src = pic;
Ihight = BaseImg.height + 30;
Iwidth = BaseImg.width + 30;
if (Ihight > 550)
{
Ihight = 550
}
if (Iwidth > 750)
{
Iwidth = 750
}
window.open(pic,null,"width="+Iwidth+",height="+Ihight+",status=no,toolbar=no,menubar=no,scrollbars=1,left=25,top=23"
;
}[/tt]
when i click on the link the window opens and its 30 by 30 pixels wide. but then if i close off the window and click on th SAME link then it opens up in the right size.
Thanking you in adavance, Rick
[tt]function openPic(pic) {
var Ihight, Iwidth;
BaseImg = new Image;
BaseImg.src = pic;
Ihight = BaseImg.height + 30;
Iwidth = BaseImg.width + 30;
if (Ihight > 550)
{
Ihight = 550
}
if (Iwidth > 750)
{
Iwidth = 750
}
window.open(pic,null,"width="+Iwidth+",height="+Ihight+",status=no,toolbar=no,menubar=no,scrollbars=1,left=25,top=23"
}[/tt]
when i click on the link the window opens and its 30 by 30 pixels wide. but then if i close off the window and click on th SAME link then it opens up in the right size.
Thanking you in adavance, Rick