|
|||||||
| JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...) |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
What is the difference between height, scrollHeight and style.height
Hi:
I have a IFrame called "dataFrame". Does anybody know the difference between document.getElementById('dataFrame').height and document.getElementById('dataFrame').Document.body.scrollHeight; and document.getElementById('dataFrame').style.height Quote:
Frustrated |
|
#2
|
||||
|
||||
|
In your case, .height refers to the value in the IFRAME's height HTML attribute. The .style.height refers to a CSS property set in the style attribute of the IFRAME tag. The .scrollHeight is the height in pixels of the scrollable area of the IFRAME. If something is taller than the scrollHeight, then scrollbars will appear on the IFRAME.
__________________
My Blog: FundaMental Disaster Accessible DHTML Tabs | Quick CSS Positioning Explanation | Quick Floated Elements Explanation | 50% + 50% != 100% | Gaps Under Images | ID vs. Class | Gappy Lists in Internet Explorer | Why Tables Are Slower | Benefits of XHTML vs. HTML | Linking to External Style Sheets | About DOCTYPES | Web Design is a Peanut Butter & Jelly Sandwhich | CSS: To Hack Or Not To Hack | Internet Explorer and Transparent PNGs |
|
#3
|
|||
|
|||
|
What is IFrame.offsetHeight
Hi:
Can you please tell me what is the parent.document.getElementById('dataFrame').offsetHeight Thanks. |
|
#4
|
||||
|
||||
|
In JavaScript, parent is a key word that allows you access to the current frame's, parent frame's window object. So:
window: The window object of the current frame parent: The window object of this window's parent frame. It can also be written as window.parent. That snippet of code says "Get the HTML tag whose Id is 'dataFrame' in the parent frame's document." And the ".offsetHeight" part is a DOM node property that is the height of an element, including any margins, padding and borders.
__________________
My Blog: FundaMental Disaster Accessible DHTML Tabs | Quick CSS Positioning Explanation | Quick Floated Elements Explanation | 50% + 50% != 100% | Gaps Under Images | ID vs. Class | Gappy Lists in Internet Explorer | Why Tables Are Slower | Benefits of XHTML vs. HTML | Linking to External Style Sheets | About DOCTYPES | Web Design is a Peanut Butter & Jelly Sandwhich | CSS: To Hack Or Not To Hack | Internet Explorer and Transparent PNGs |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|