Forum Moderators: open
I have the following problem:
<html>
<head>
<title>enlarge.htm</title>
<script language="javascript" type="text/javascript">
image_1 = new Image()
image_1.src = "img/image_big.jpg"
//DetectImageSize function
function DetectImageSize(picName,picTitle){
picURL=picName.src
newWindow=window.open(picURL,'_blank','toolbar=no, left=200,top=100,scrollbars=no, width='+picName.width+',height='+picName.height)
newWindow.document.write('<html><head><title>'+picTitle+'<\/title><\/head><body background="'+picURL+'"><\/body><\/html>')
newWindow.resizeBy(picName.width-newWindow.document.body.clientWidth, picName.height-newWindow.document.body.clientHeight)
newWindow.focus()
}
//-->
</script>
</head>
<body>
<a href="javascript:DetectImageSize(image_1,'Title')">
<img src="img/image_small.jpg" alt="" class="image_bikini"/></a>
</body>
</html>
This script does not work on Mac browsers, crops the image opened in the new window. On PC everything is fine. Can anyone help me please :(
Best Regards,Ani
if (navigator.appVersion.indexOf('Mac')!= -1)
history.go(0)
;
<added>
It just struck me that you could simplify the work on the browser by avoiding the resizeBy() step altogether. Since the script has got the width and height, just open the window that size to begin with, right?
clientWidth is part of the MSIE's DHTML object model.
clientWidth is not part of any W3C specification or technical recommendation.