New Image Size

Javascript coding ..

Moderators: egami, macek, gesf

Post Reply

Thu May 17, 2007 12:39 pm

I have a little code like the following:

Code: Select all

<script language='JavaScript' type='text/javascript'>
function ReplaceImage(alt_image,Pic_X,Pic_Y){
OutPic = new Image(Pic_X,Pic_Y);
and than some HTML like this:

Code: Select all

<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.


Post Reply