Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

document.body.clientHeight - not working

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

New User

10+ Year Member

joined:Apr 21, 2005
votes: 0

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!

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 3, 2005
votes: 0

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

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members