Crash1hd
01-18-2003, 06:19 AM
Ok I have a script that I want to use to make a div tag show in the dead center of the page works great in IE! but of course like everything else it doesnt work in netscape :) here is the script!
<SCRIPT>
function fnInit() {
if(ie){DivID.style.setExpression("left", "document.body.clientWidth/2 - Welcome.offsetWidth/2");} if(ns){Welcome.setExpression("left", "innerWidth/2 - DivID.offsetWidth/2");}
if(ie){DivID.style.setExpression("top", "document.body.clientHeight/2 - Welcome.offsetHeight/2");} if(ns){Welcome.setExpression("top", "innerHeight/2 - DivID.offsetWidth/2");}
}
onlOad=fnInit
</SCRIPT>
<div id="DivID" style="position:absolute;visibility:hidden">
document body content
</div>
so what do I replace the offsetWidth and the offsetHeight with for netscape? also what would work for the setExpression as the error I get in netscape is DivID is not defined.
<SCRIPT>
function fnInit() {
if(ie){DivID.style.setExpression("left", "document.body.clientWidth/2 - Welcome.offsetWidth/2");} if(ns){Welcome.setExpression("left", "innerWidth/2 - DivID.offsetWidth/2");}
if(ie){DivID.style.setExpression("top", "document.body.clientHeight/2 - Welcome.offsetHeight/2");} if(ns){Welcome.setExpression("top", "innerHeight/2 - DivID.offsetWidth/2");}
}
onlOad=fnInit
</SCRIPT>
<div id="DivID" style="position:absolute;visibility:hidden">
document body content
</div>
so what do I replace the offsetWidth and the offsetHeight with for netscape? also what would work for the setExpression as the error I get in netscape is DivID is not defined.