Højde på nyt vindue.
Vha. nedenstående script åbner jeg et nyt vindue, og viser et billede.Hvis jg anvender PopupBillede1, så passer højden inkl. de 15 pixel. Men hvis jeg anvender PopupBillede (som jeg selv sender højden til, så bliver højde hele skærmen.
Er der nogen der kan gennemskue problemet?
******** SCRIPT START *****************
<script language="JavaScript" type="text/javascript">
function PopupBillede(file, tekst, width, height){
// h=height+15;
winTop=(screen.height-height)/2;
winLeft=(screen.width-width)/2;
newWin=window.open("","VisBillede","height="+height+",width="+width+",top="+winTop+",left="+winLeft+",scrollbars=no,status=no");
newWin.document.writeln('<ht'+'ml>');
newWin.document.writeln('<he'+'ad>');
newWin.document.writeln('<ti'+'tle>'+file+'<\57tit'+'le>');
newWin.document.writeln('<link rel="stylesheet" type="text/css" href="css/bball.css">');
newWin.document.writeln('<\57he'+'ad>');
newWin.document.writeln('<bo'+'dy style="border:0px;margin:0px">');
newWin.document.writeln('<d'+'iv id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;">');
newWin.document.writeln('<\57d'+'iv>');
// newWin.document.write('<scr'+'ipt language="JavaScript" src="overlib.js">');
// newWin.document.write('<!'+'-- overLIB (c) Erik Bosrup --'+'><\57scr'+'ipt>');
newWin.document.writeln('<cen'+'ter>');
// newWin.document.writeln('<a href="java script:void(0);" onmouseover="return overlib(\47'+tekst+'\47);" onmouseout="return nd();">');
newWin.document.writeln('<i'+'mg name="billede" src="'+file+'" style="overflow:hidden;top:0px;left:0px;border:0px;">');
// newWin.document.writeln('<\57a>');
newWin.document.writeln('<a href="java script:window.close();">Luk vinduet<\57a>');
newWin.document.writeln('<\57ce'+'nter><\57b'+'ody><\57ht'+'ml>');
newWin.document.close();
}
function PopupBillede1(file, tekst){
picture=new Image();
picture.src=file;
h=picture.height+15;
w=picture.width;
winTop=(screen.height-h)/2;
winLeft=(screen.width-w)/2;
newWin=window.open("","VisBillede","height="+h+",width="+w+",top="+winTop+",left="+winLeft+",scrollbars=no,status=no");
newWin.document.writeln('<ht'+'ml>');
newWin.document.writeln('<he'+'ad>');
newWin.document.writeln('<ti'+'tle>'+file+'<\57tit'+'le>');
newWin.document.writeln('<link rel="stylesheet" type="text/css" href="css/bball.css">');
newWin.document.writeln('<\57he'+'ad>');
newWin.document.writeln('<bo'+'dy style="border:0px;margin:0px">');
newWin.document.writeln('<d'+'iv id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;">');
newWin.document.writeln('<\57d'+'iv>');
// newWin.document.write('<scr'+'ipt language="JavaScript" src="overlib.js">');
// newWin.document.write('<!'+'-- overLIB (c) Erik Bosrup --'+'><\57scr'+'ipt>');
newWin.document.writeln('<cen'+'ter>');
// newWin.document.writeln('<a href="java script:void(0);" onmouseover="return overlib(\47'+tekst+'\47);" onmouseout="return nd();">');
newWin.document.writeln('<i'+'mg name="billede" src="'+file+'" style="overflow:hidden;top:0px;left:0px;border:0px;">');
// newWin.document.writeln('<\57a>');
newWin.document.writeln('<a href="java script:window.close();">Luk vinduet<\57a>');
newWin.document.writeln('<\57ce'+'nter><\57b'+'ody><\57ht'+'ml>');
newWin.document.close();
}
</script>
******** SCRIPT SLUT *****************
