Forum Moderators: open
This script just executes ... what I am curios about is if I am properly calling the changeStyle function? I am unaware of any Javascript validator but I figured I may be missing something here as far as calling the function goes.
If you wish to test this out, just add div.body {#000 solid 1px} to the style...does not work in IE (not worried about that in this post though).
<script type="text/javascript">
<!--
function changeStyle()
{
myheight = document.getElementById("DivBody");
myheight.style = window.innerHeight-20;
mywidth = document.getElementById("DivBody");
mywidth.style = window.innerWidth-20;
}
function resizeDiv() {
}
document.writeln('<div id="DivBody" class="body">'); resizeDiv();
//-->
</script>
myheight = document.getElementById("DivBody");
myheight.style = window.innerHeight-20;
This can't be right!
myheight holds a reference to the DIV. You then attempt to reassign its style property. Perhaps this...
document.getElementById("DivBody").style.height = window.innerHeight-20;
IE & Opera don't have a
window.innerHeight property (as discussed prev).