473,327 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

img.height for Internet Explorer

2
Hi
Issue: IE 7/Win XP
Works for FF2.0/Win XP

I am loading bunch of images on web page, I am in need of img.height property but it is coming as 0 for the Internet Explorer 7. It works as expected for FireFox 2.0 and am I not sure how can I resolve the same. I am preloading the images as well but it is of no use. I am providing window.setTimeout for giving time for image to load but that does not help either. The
img.complete comes as false, while img.readystate == "complete" comes as true.

Any help would be appreciated.
Mar 22 '08 #1
3 1515
acoder
16,027 Expert Mod 8TB
Try calling from img.onload.
Mar 22 '08 #2
rajesk
2
Thank you for the response. I sincerely appreciate it. I am using onload to load the javascript method on the image. The way I was able to resolve this issue is, I am verifying for img.complete and then copying the src and return the new object. So snippet:

Expand|Select|Wrap|Line Numbers
  1. var newImageObj = new Image();
  2. if (img != null)
  3. {
  4.    newImageObj.src = img.src;
  5.    return newImageObj;  //this object contains height   
  6. }
  7. else
  8. {
  9.   return img; 
  10. }
Mar 26 '08 #3
acoder
16,027 Expert Mod 8TB
I see you've got it working with the complete property. The alternative as I suggested earlier is the onload before you set the src property.
Mar 27 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Robert Mark Bram | last post by:
Howdy All! Is there an easy way to find out the pixel height and width of an image? I want to write IMG tags in this form: <img src="../images/BigM_off.gif" width="173" height="169" name="BigM"...
5
by: Chandler | last post by:
Hi, I have a div with a background image. The height of the div needs to stretch to accomodate any changes of internal content, but needs to remain at least 400px so that the background image is...
2
by: Marek Mänd | last post by:
I have problems with table row height by Internet Explorer6 in xhtml1 css1compat mode document. The table has fixed height and on one TFOOT row the height is set to 'auto' to make it have...
2
by: Marek Mänd | last post by:
I have simple structure like: <div> <h3 style="text-align:center;"> <span style="float:right;">input type="image"/></span> <span style="float:left;">input type="image"/></span> boxes titlebar...
10
by: Roderik | last post by:
Hi, At: http://www.sylviastrijk.nl/examenklas/ In Internet Explorer we see the background of the wrapping div (#namenlijst) (with the columns (kolom 1, kolom 2, kolom 3) inside) as far as the...
3
by: TheXenocide | last post by:
Hello, First and foremost I'll describe a bit about my problem: I'm trying to make a site layout using ASP.NET 2.0 in Visual Studio .NET 2005 Beta 2. The site is a table based layout that is...
0
by: Jean Pierre Daviau | last post by:
Hi , I went on déjà news to browse previous posts on this subject. It seems there is only a complicated way to do this simple thing in internet explorer. I would like to create a table...
4
by: rfox | last post by:
I have a two-column layout where I want the left column to have a colored background while the right column (main content div) has a white background. Please see...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.