hab mal im internet ein script gefunden, wo ein bild in einem popup geöffnet ist, welches exakt die größe des geöffneten bildes hat.
das ganze hat auch relativ lange gut funktioniert, aber irgendwie hab ich jetzt neuerdings den fehler dass das script immer nur noch ca. 90% des bildes anzeigt.
das nervt.... es nervt aber noch mehr, dass ich auf den fehler nicht draufkomm.....

wäre toll wenn sich das mal einer anschaun könnte.


picture.php
Code:
<html>
<head>
<title>Bildergalerie</title>
<style type="text/css">
body { margin:0; padding:0; }
img { display:block; }
</style>
 <script type="text/javascript">
   var isNN,isIE;
   if (parseInt(navigator.appVersion.charAt(0))>=4){
     isNN=(navigator.appName=="Netscape")?1:0;
     isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
}
function reSizeToImage(){
     if (isIE) {
       window.resizeTo(100,100);
       width=100-(document.body.clientWidth-document.images[0].width);
       height=100-(document.body.clientHeight-document.images[0].height);
       window.resizeTo(width,height);
}
     if (isNN) {
       window.innerWidth=document.images["pic0"].width;
       window.innerHeight=document.images["pic0"].height;
}
}
</script>
</head>
<body bgcolor=000000 scroll="no" onload="reSizeToImage();self.focus()" onblur="self.close()">
 <img id="pic0" name="pic0" src='<?=$_GET["picname"]?>'>
</body>
</html>

aufrufbefehl:
Code:
<html>
<head>
<script language="JavaScript">

<!--
var ns = (document.all)?false:true;
var browserVersion = parseFloat(navigator.appVersion );
PositionX = 100;
PositionY = 100;
defaultWidth  = 420;
defaultHeight = 420;
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function popup(imageURL){
if (isNN){imgWin=window.open('picture.php?picname='+imageURL,'',optNN);}
if (isIE){imgWin=window.open('picture.php?picname='+imageURL,'',optIE);}
}
//-->
</script>
</head>

<body>

Link:
<a href="javascript:popup('test/test_031.jpg');"><img src="test/thumbs/test_031.jpg" alt="Zum vergrößern klicken" border="0"></a></img>

</body>
</html>
greets,
[JLA]