IE innerHeight hack success

D

DOT

Hi,

for all those who weren't successfull to determine the height of the
innerWindow for the Microsoft Internet Explorer, maybe this will be a
solution:

<!--- Embed this into your Document --->
<!--- IE innerHeight-HACK by Roman Dissertori --->
<div id="IEhackInnerHeight"
style="position:absolute;top:100%;left:100px;z-index:1;visibility:hidden;"></div>

<!--- you need to run this function with <body onload="Browser();"> --->
<script type="text/javascript">
function Browser()
{
// IE innerHeight-HACK by Roman Dissertori (Prototype - but it works)
var
AdaptedHeight=document.getElementById('IEhackInnerHeight').offsetTop-30;
document.getElementById('IEhackInnerHeight').style.top =
AdaptedHeight+'px';
if(typeof innerHeight == 'number') // if browser knows innerHeight
document.getElementById('MainHeight').height=window.innerHeight-20;
else // if browser (for example IE) does not know innerHeight

document.getElementById('MainHeight').height=document.getElementById('IEhackInnerHeight').offsetTop;
}
</script>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top