473,804 Members | 2,536 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

img.height for Internet Explorer

2 New Member
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.setTimeo ut 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 1530
acoder
16,027 Recognized Expert Moderator MVP
Try calling from img.onload.
Mar 22 '08 #2
rajesk
2 New Member
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 Recognized Expert Moderator MVP
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
7867
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" alt="Logo Rollover!"> so I am looking for an app or windows thingy that can quickly tell me the height and width of an image. Thanks for any advice!
5
18650
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 showing at all times. I can't set the height to 400px, because it will prevent any of it's other styles from being displayed if the content's height exceeds 400px. I also can't set the height to auto, since the content might be much be less than...
2
15912
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 flexible height, which will shrink if there are more rows in TBODY and which will grow if there are fewer rows in TBODY. However IE6 has huge troubles with this simple concept and doesnt seem want to make the auto-heighted row to behave as auto...
2
6974
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 </h3> <div> box content
10
3459
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 content inside it. In Firefox you see no height for the wrapping div and the background-color won't stretch to the end of the columns. The view in internet explorer is the desired one. What might be the reason that FF has no height for the...
3
5535
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 supposed to consume the entire viewing area (oldschool HTML was <table width="100%" height="100%">). This is not as easy as it sounds using the forementioned technologies. I am using some ASP.NET 2.0 controls that specifically depend on the way...
0
1088
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 with a height of 100% with five rows of 20% <TABLE height=100%> <TR height=20%>
4
2779
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 http://www4.scoe.net/rfox/nest/index4.html My problem is that the colored background in the left column only extends to the height of the content leaving a white gap below it. How can I make the left nav's color stretch the entire height? On a side note, in Internet Explorer...
0
9711
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9591
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10331
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9166
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6861
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5667
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4306
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 we have to send another system
3
3001
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.