homepage Welcome to WebmasterWorld Guest from 54.161.240.10
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
document.body.clientHeight - not working
designer123




msg:3557687
 9:44 am on Jan 25, 2008 (gmt 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!

 

daveVk




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

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved