Forum Moderators: open

Message Too Old, No Replies

Gecko equivelent to clientHeight/Width?

Javascript error generated in console...

         

JAB Creations

8:58 pm on Aug 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This script uses clientHeight/Width but generates a script error in Gecko browsers (though it does at least render as desired). I'm trying to kill off any errors I come across (even if normal people don't see them). I know someone somewhere mentioned what the equivelent is in Gecko browsers but I can't seem to find it. Anyway here is the code I currently use...

<script type="text/javascript"><!--
function resizeDiv() {
if ((navigator.userAgent.indexOf("Opera 6")!=-1)¦¦(navigator.userAgent.indexOf("Opera/6")!=-1))
{ height = document.body.clientHeight-20;
width = document.body.clientWidth-20; }
else if (navigator.userAgent.indexOf("Opera")!=-1) {height = document.body.clientHeight-120; width = document.body.clientWidth-30;}
else {height = document.body.clientHeight-20; width = document.body.clientWidth-20;} document.getElementById('DivBody').style.width = width; document.getElementById('DivBody').style.height = height; }
document.writeln('<div id="DivBody" class="body">'); resizeDiv(); //-->
</script>

JAB Creations

11:43 pm on Aug 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ahh! Nevermind, I found it!

[bugzilla.mozilla.org...]