Forum Moderators: open
this is my script
<script language="Javascript" type="text/javascript">
<!--//
function imageView(imgFile,imgTitle,imgWidth,imgHeight,winPosX,winPosY){
preview = window.open("","","resizable=no,toolbar=no,scrollbars=no,menubar=no,status=no,directories=no,width="+imgWidth+",height="+imgHeight+",left="+winPosX+",top="+winPosY+"");
preview.document.write('<html><head><title>'+imgTitle+' - Click to close - <\/title><\/head>'
+'<body onBlur="self.focus();" marginWidth="0" marginHeight="0" topmargin="0" leftmargin="0">'
+'<center>'
+'<a href="java script:self.close()">'
+'<img border="0" alt="Image loading please wait...." src="'+imgFile+'" width="'+imgWidth+'" height="'+imgHeight+'">'
+'<\/a><\/center>'
+'<\/body><\/html>');
preview.document.close();
}
//-->
</script>
Also it seems that the popup image thinks it is a link to somewhere else instead of just being a static image that can be closed.
any help would be appreciated.
cheers
Gecko
One way to fix the problem is to add 4 pixels to the height when sizing the window, you will get a little bit of whitespace around the image, but the scroll bars dissapear.
preview = window.open("","","resizable=no,toolbar=no,scrollbars=no,menubar=no,status=no,directories=no,width="+imgWidth+",height="+(imgHeight+4)+",left="+winPosX+",top="+winPosY+"");
var params = "resizable,width="+imgWidth+",height="+imgHeight+",left="+winPosX+",top="+winPosY;
preview = window.open("","",params);
You noticed I left resizable in. Can you predict every situation of every browser, platform, and resolution out there, including scenarios that may not have yet been developed? If not, always allow the user to resize the window. Always. :-)