473,396 Members | 1,748 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,396 software developers and data experts.

question about style.height

Hi, all

If I didn't set the height of an html element on a web page with html
attributes. Then obj.style.height always reports "0" even after the page has
completely rendered. Is there any way to get the actual height after being
rendered?

Jack
Jul 23 '05 #1
1 4294
Ron
datactrl wrote:
Hi, all

If I didn't set the height of an html element on a web page with html
attributes. Then obj.style.height always reports "0" even after the page has
completely rendered. Is there any way to get the actual height after being
rendered?

Jack

The following code will get the computed height in pixels:

var obj = document.getElementById("myObject");
var objHeight = null;
if(document.implementation.hasFeature("CSS", "2.0")) {
objHeight = document.defaultView.getComputedStyle(obj,
null).getPropertyCSSValue("height").getFloatValue( 5);
}
else if(obj.clientHeight!=null) {
objHeight = obj.offsetHeight;
}

Learn more about the W3C CSS interfaces at
http://www.w3.org/TR/DOM-Level-2-Style . IE's offsetHeight property was
found at
http://msdn.microsoft.com/workshop/a...fsetheight.asp
..
Jul 23 '05 #2

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

Similar topics

5
by: Greg | last post by:
I have a page that searches a database by a repairman's name and by a date range. It pulls info by the repairman's name but pulls all info in the database regardless of the date. Below is the code...
4
by: ac | last post by:
Hi, I have to customize a component (in this case Windows Media Player) so that a circular window is shown upon the player. That is, suppose you have a movie playing (in the ordinary rectangle...
1
by: Brian Wilson | last post by:
Could someone help me with how to center or pocission this document to the center of the page? <body onload="ImageBook()"> <script type="text/javascript"> // 7 variables to control behavior...
5
by: amerar | last post by:
Hi All, I have this CSS that I use in one of my emails. When I view the email in Netscape, the style sheet looks fine and the page comes out fine....... However, when I view the email using...
33
by: amerar | last post by:
Hi All, I can make a page using a style sheet, no problem there. However, if I make an email and send it out to my list, Yahoo & Hotmail totally ignore the style tags. It looks fine in...
1
by: amerar | last post by:
Hi All, I posted a question about style sheets, and why certain email clients were ignoring them. Someone suggested placing them inline. I did this and get better results, but not what I...
0
by: Michelle Keys | last post by:
I am trying to call a print function to print a string from a database using javascript. Which is RC_DATA of Varchar2(2500). This is a javascript is not being used. I have a thing that needs to...
1
by: Sallana | last post by:
Hello guys. My name is Lynne and I am currently trying to build a website for a game that I play online called Exodus. This is the page --> http://exodus.mudmagic.com Immediately you can...
25
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if my question needs to be here or in coldfusion. If i have my question is in the wrong section i am sorry in advance an will move it to the correct section. ...
3
by: vanald04 | last post by:
Tried searching for the right article and saw some similar questions that if I knew more would probably be helpful, but I couldn't get the coding exactly right for my specific situation. So, thanks...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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,...

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.