alaios
08-24-2002, 08:24 PM
i want to open a new window in the picture dimensions
Ia m using the folowing code to resize the window
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7">
<script language="JavaScript">
var number=document.URL
var number=number.split('/');
var mikos=number.length;
var eikona=number[mikos-1]; //1.htm
var mikos=eikona.length;
var eikona=eikona.substr(0,mikos-4);
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div align="center"> <a href="javascript:window.close();"><img src="" name="pic1" border="0" alt="Êëåßóéìï Ðáñáèýñïõ" height="300">
</a>
<script language="JavaScript">
document.images['pic1'].src=eikona+".jpg";
setTimeout("resize();",500);
function resize()
{
var width=document.images['pic1'].width;
var height=document.images['pic1'].height;+
window.resizeTo(width,height);
if (window.screen) {
self.moveTo((screen.availWidth-width)/2,(screen.availHeight-height)/2);
}
}
</script>
</div>
</body>
</html>
the main problem is that when the window opens is very small because (<img src="" name="pic1" border="0" alt="Êëåßóéìï Ðáñáèýñïõ" height="300"> ) and the bigger picture is being loaded in the small window.What i must do.. I was thinging to use the onload to resample the wind?ow to the picture! plz help me
Ia m using the folowing code to resize the window
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7">
<script language="JavaScript">
var number=document.URL
var number=number.split('/');
var mikos=number.length;
var eikona=number[mikos-1]; //1.htm
var mikos=eikona.length;
var eikona=eikona.substr(0,mikos-4);
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div align="center"> <a href="javascript:window.close();"><img src="" name="pic1" border="0" alt="Êëåßóéìï Ðáñáèýñïõ" height="300">
</a>
<script language="JavaScript">
document.images['pic1'].src=eikona+".jpg";
setTimeout("resize();",500);
function resize()
{
var width=document.images['pic1'].width;
var height=document.images['pic1'].height;+
window.resizeTo(width,height);
if (window.screen) {
self.moveTo((screen.availWidth-width)/2,(screen.availHeight-height)/2);
}
}
</script>
</div>
</body>
</html>
the main problem is that when the window opens is very small because (<img src="" name="pic1" border="0" alt="Êëåßóéìï Ðáñáèýñïõ" height="300"> ) and the bigger picture is being loaded in the small window.What i must do.. I was thinging to use the onload to resample the wind?ow to the picture! plz help me