homepage Welcome to WebmasterWorld Guest from 54.205.207.53
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

    
Change DIV Min-Height Dynamically
j2trumpet

5+ Year Member



 
Msg#: 3880915 posted 11:03 pm on Mar 28, 2009 (gmt 0)

I need my script to detect the height of the viewable area of the window, then set the min-height CSS property of my div (id="wrapper") to equal that amount, essentially extending the div to the very bottom of the viewable area. My script works in Firefox, Opera, and Safari, but I'm getting "invalid argument" errors from IE and AOL about the last line of code before the final bracket. I'd love some help.

function findLivePageHeight() {
if (window.innerHeight) {
return window.innerHeight;
}
if (document.body.clientHeight) {
return document.body.clientHeight;
}
return (null);
}

var livePageHeight = findLivePageHeight();

function changeHeight() {
var object = document.getElementById('wrapper');
object.style.minHeight = livePageHeight + 'px';
}

 

whoisgregg

WebmasterWorld Senior Member whoisgregg us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3880915 posted 8:53 pm on Mar 30, 2009 (gmt 0)

Hello j2trumpet!

min-height isn't supported by older versions of IE. What version did you test in?

j2trumpet

5+ Year Member



 
Msg#: 3880915 posted 8:58 pm on Mar 30, 2009 (gmt 0)

IE 7

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