I have made a pop-up window which recive some data from a form, and then shows a image with some other data.
I want to make the window proportional to the image. I found a code which worked before adding the data sistem, but now it doesn't work. Anybody knows why of how to fix it?
I call the pop-up using:
--------------------------
---------
<script language="Javascript">
function PopupPic(sPicURL,ref,ampla
da,alcada)
{
window.open( "imatge.htm?imatge="+ sPicURL + "&referencia="+ref+"&lada=
"+amplada+
"&alcada="
+alcada, "",
"resizable=1,HEIGHT=600,WI
DTH=600");
}
</script>
<a href="javascript:PopupPic(
'images/20
03/diapost
0836_a.jpg
','52','21
','21')"><
img src="images/2003/diapost08
36_t.jpg" width="152" height="154" border="0"></A>
--------------------------
---------
And the pop-up window has the following code:
--------------------------
---------
<script language='javascript'>
var STDIN = unescape(location.search.r
eplace(/\+
/g,' '));
STDIN = STDIN.substring(1).split('
&');
for(i=0;i<STDIN.length;i++
) STDIN[i] = STDIN[i].split('=');
var picUrl = STDIN[0][1];
var alcada = STDIN[2][1];
var ref = STDIN[1][1];
var lada = STDIN[3][1];
function FitPic() {
iWidth = (NS)?window.innerWidth:doc
ument.body
.clientWid
th;
iHeight = (NS)?window.innerHeight:do
cument.bod
y.clientHe
ight;
iWidth = document.images[0].width - iWidth;
iHeight = document.images[0].height - iHeight;
window.resizeBy((iWidth+50
0), (iHeight+600));
'window.resizeBy((500+20),
(500+50));'
self.focus();
};
</script>
</HEAD>
<BODY BGCOLOR="#336699" TEXT="#FFFFFF" STYLE="font-family: Arial" onload='FitPic();' topmargin="0"
marginheight="0" leftmargin="0" marginwidth="0">
<script language='javascript'>
document.write( "<img src='" + unescape(picUrl) + "' border=0>" );
</script>
</CENTER>
</BODY>
</HTML>
--------------------------
---------
thanks
Start Free Trial