Hi,
i have a big problem...i'm using one jscript for resizing of all of my pics
in popUp...in main html i'm having many little pics and clicking on them
they open in popUp and resize to larger version of the same pic.
now, it works fine and sometimes when i click on little one it doesn't
resize well...
this is the code:
main.html
<a href="#" onclick="javasc ript:
window.open('/html/popUp.html','Ma lo','toolbar=0, location=0,dire ctories=0,st
atus=0,menubar= 0,scrollbars=0, resizable=0');r eturn false;">
<IMG src="/images/thumbs/Malo.jpg" border="0">
</a>
popUp.html
<script language="JavaS cript">
var pic = new Image();
var url='/images/pics/'+name+'.jpg'; // name='Malo' from main.html
pic.src = url;
function resizing(){
window.location =url;
var wid=pic.width+3 0; // sometimes pic.width=0 and wid=30 and
sometimes is OK
var hei=pic.height+ 50; // sometimes pic.height=0 and hei=50 and
sometimes is OK
alert("wid="+wi d+"\n"+"hei="+h ei);
window.resizeTo (wid, hei);
}
</script>
</head>
<body onload="javascr ipt: resizing();">
</body>
i don't know what hapens...maybe some pic doesn't have time to load so
pic.width and height is 0 but when i close popUp and open it again for the
same pic, it resizes well...i mean, the pic that resizes wrong second time
resizes well...
If someone know what i'm doing wrong help please!!!
Thank You very much!
i have a big problem...i'm using one jscript for resizing of all of my pics
in popUp...in main html i'm having many little pics and clicking on them
they open in popUp and resize to larger version of the same pic.
now, it works fine and sometimes when i click on little one it doesn't
resize well...
this is the code:
main.html
<a href="#" onclick="javasc ript:
window.open('/html/popUp.html','Ma lo','toolbar=0, location=0,dire ctories=0,st
atus=0,menubar= 0,scrollbars=0, resizable=0');r eturn false;">
<IMG src="/images/thumbs/Malo.jpg" border="0">
</a>
popUp.html
<script language="JavaS cript">
var pic = new Image();
var url='/images/pics/'+name+'.jpg'; // name='Malo' from main.html
pic.src = url;
function resizing(){
window.location =url;
var wid=pic.width+3 0; // sometimes pic.width=0 and wid=30 and
sometimes is OK
var hei=pic.height+ 50; // sometimes pic.height=0 and hei=50 and
sometimes is OK
alert("wid="+wi d+"\n"+"hei="+h ei);
window.resizeTo (wid, hei);
}
</script>
</head>
<body onload="javascr ipt: resizing();">
</body>
i don't know what hapens...maybe some pic doesn't have time to load so
pic.width and height is 0 but when i close popUp and open it again for the
same pic, it resizes well...i mean, the pic that resizes wrong second time
resizes well...
If someone know what i'm doing wrong help please!!!
Thank You very much!
Comment