473,508 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can javascript give me image dimensions?


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?
Jul 20 '05 #1
1 17709

"Randell D." <yo**************************@yahoo.com> 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>
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2634
by: Henk Verhoeven | last post by:
(Reply on this newsgroup to an email - reply by email did not work) Wolfman wrote: > > Hi, > I found your Email in the php Newsgroup. > I was looking for some way to resize some graphiks on my...
3
11737
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
2
9199
by: Roger Withnell | last post by:
I browse for an image using form input type file and call a JavaScript function with onchange. I then want the function to check the image's properties (width, height, filesize). In WinIE,...
7
3570
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
1
1898
by: rob c | last post by:
Hi Is it possible to get the dimensions of a jpg file using javascript? I'd like to open a sub-window to display an image and have window slightly larger (for example, 100pixels wider and...
136
9201
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
6
9882
by: MurrayTh | last post by:
Is there any way to determine the dimensions of an image using the image's URL? ie load image based on URL, and then get dimensions? or perhaps better method?
2
4112
by: Adam Teale | last post by:
hey guys Is there a builtin/standard install method in python for retrieving or finding out an image's dimensions? A quick google found me this:...
2
1774
by: AAaron123 | last post by:
I have an image inside a table cell. I'd like to scale the image to fill the cell. I have a javascript routine that can change the image's height but can't seem to fine a place to call it with...
0
7229
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7129
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7333
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4716
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1566
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
428
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.