Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Can javascript give me image dimensions?

Reply
Thread Tools

Can javascript give me image dimensions?

 
 
Randell D.
Guest
Posts: n/a
 
      09-25-2003

Folks,
I want to create a popup for thumbnail images (jpg, png, gif) and wonder if
I can create a popup that opens a new window whereby the image fits the new
window 100%... I know I can have my Apache/PHP server do this, but my
preference leans towards clientside javascript...

Thus... can javascript calcuate the width/height of an image for me to do
the above?

thanx

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?


 
Reply With Quote
 
 
 
 
Randell D.
Guest
Posts: n/a
 
      09-26-2003

"Randell D." <(E-Mail Removed)> wrote in message
news:uYvcb.17624$TM4.16131@pd7tw2no...
>
> Folks,
> I want to create a popup for thumbnail images (jpg, png, gif) and wonder

if
> I can create a popup that opens a new window whereby the image fits the

new
> window 100%... I know I can have my Apache/PHP server do this, but my
> preference leans towards clientside javascript...
>
> Thus... can javascript calcuate the width/height of an image for me to do
> the above?
>
> thanx
>


Got it... from an old post...

<script Language='javascript1.2' type='text/javascript'>
<!--
function iLoad(isrc) {
var oImg = new Image();
oImg.src = isrc;
if (oImg.complete) {
window.alert(oImg.src + ' ' + oImg.width + ' x ' + oImg.height);
}
else {
window.setTimeout('iLoad(imgsrc)', 1000);
}
}
//-->
</script>
</HEAD>
<body onLoad='iLoad(imgsrc)'>
</body>
</HTML>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
We dont give only job... We give you the Job Satisfaction....... Anuj Digital Photography 0 01-02-2007 06:35 PM
GIVE ME FILM OR GIVE ME DEATH l#vfgsgEg@AO1.com DVD Video 4 07-14-2005 03:10 PM
Why wouldn't this line of give give the address of the pointer? grocery_stocker C Programming 10 05-25-2005 03:05 AM
Give us 3 minutes; we give you the whole library lib Computer Support 1 02-04-2005 03:16 AM
Give us 3 minutes; we give you the whole library lib Computer Support 0 01-27-2005 07:52 AM



Advertisments