Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ScrollHeight and onload
Message
De
07/05/2014 09:32:11
 
 
À
Tous
Information générale
Forum:
Javascript
Catégorie:
IFrame
Titre:
ScrollHeight and onload
Divers
Thread ID:
01599669
Message ID:
01599669
Vues:
44
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform