New Image Size

Javascript coding ..

Moderators: macek, egami, gesf

Post Reply
User avatar
New php-forum User
New php-forum User
Posts: 121
Joined: Sat Jan 03, 2004 7:06 pm
Location: New York, NY

New Image Size

Post by popeye » 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

Who is online

Users browsing this forum: No registered users and 1 guest