Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ScrollHeight and onload
Message
From
07/05/2014 09:32:11
 
 
To
All
General information
Forum:
Javascript
Category:
IFrame
Title:
ScrollHeight and onload
Miscellaneous
Thread ID:
01599669
Message ID:
01599669
Views:
43
I have the following in the body line of an IFrame so to call a function which will give me the exact height of the frame:
<body id="LXBody" onload="GetHeight()">
This is the GetHeight() function:
function GetHeight()
{
   loIFrame=window.parent.document.getElementById("IFrameMenu")
   loIFrameDocument=loIFrame.contentDocument || (loIFrame.contentWindow && loIFrame.contentWindow.document)
   nIFrameMenuPreviousHeight=loIFrameDocument.body.scrollHeight
}
This is really called after the load of the page is done. The nIFrameMenuPreviousHeight value however is from the HTML page default 2000 height value I have given.

Then, on the page, I have a button. If I click on that button, it execute the same code and gives the proper value.

So, something is not working accordingly to what is expected. The GetHeight() function called after the page has finished loading should give the proper value of 1327. But, only when I click on a button, I obtain it.

Anyone would see what is wrong here?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform