You are here: Image Size Not Being Recognized « HTML « IT news, forums, messages
Image Size Not Being Recognized

Posted by Nonee on 10/24/05 22:12

Hello,

Ok, I wrote a function to blow up a thumbnail image by
replacing the thumbnail with an original size image. When you click
the thumbnail, a new window opens up with the size based on the
original image + 150 or 100 (height, width respectively). Well, I can
get the name of the original image perfectly but when it creates the
new window, it doesn't have the correct size of the image to make the
window. In fact, is makes a tiny window (possibly the size of the
thumbnail or it is using 0). I am not sure if maybe I should preload
the image or something so the browser has the correct original image
size? Well, here is the code:

var a,x;
var winHeight, winWidth;

// Finding the original image src from the thumb src
a = filename.indexOf('thumbs');
x = filename.substring(0,a) +
filename.substring(a+9,filename.length);


anImage.src = x;
winHeight = anImage.height+150;
winWidth = anImage.width+100;




I put in:

if (anImage.height < 1)
{
anImage.height = 500;
anImage.width = 320;
}

....between the x=filename and the anImage.src = x but that didn't work
either. Not sure what is happening. I suppose I should trace it a
bit. As I do that, anyone have any advice?

Thanks,

Josh

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация