Forum Moderators: open

Message Too Old, No Replies

document.body.clientHeight - not working

         

designer123

9:44 am on Jan 25, 2008 (gmt 0)

10+ Year Member



Guys I wrote this function 'newWidthHeight' in javascript to dynamically capture the width and height of the screen and display the div ‘abc’. The code is working fine for controlling the width but its not working while controlling the height. Line no 3 and 4 not working could u help me guide whats wrong in the script.

function newWidthHeight()
{

var xWidth = document.body.clientWidth;
document.getElementById('abc').style.width = xWidth;
var xHeight = document.body.clientHeight;
document.getElementById('abc').style.height = xHeight;

}

Thanks - DZyNer!

daveVk

1:04 am on Jan 26, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



see [quirksmode.org...] may account for problem, but would effect clientWidth also?