New Image Size

A

Anonymous

Guest
I have a little code like the following:

Code:
<script language='JavaScript' type='text/javascript'>
function ReplaceImage(alt_image,Pic_X,Pic_Y){
OutPic = new Image(Pic_X,Pic_Y);
OutPic.src=alt_image;
document.i_ImgName.src=OutPic.src;
}
</script>

and than some HTML like this:

Code:
<img src='picofweek.jpg' alt='Picture of the Week' Width='PicX' Height='PicY' align='right' name='i_ImgName' border='1'>
<img src='thumnail1.jpg'  border='0' onClick="ReplaceImage('realpicture1.jpg',Pic1X,Pic1Y)">
<img src='thumnail2.jpg'  border='0' onClick="ReplaceImage('realpicture2.jpg',Pic2X,Pic2Y)">

The replaced pictures never takes the X and Y sizes of the realpictures. It always defaults to the size of 'picofweek.jpg' and therefore sometimes have unbalanced resolution. :?
I appreciate any suggestions.

Thanks
 
Back
Top