View Single Post
Old 05-08-2008, 08:56 PM   #8 (permalink)
Jim
The Addict
 
Jim's Avatar
 
Join Date: Nov 2007
Location: the Netherlands
Posts: 281
Thanks: 2
Jim is on a distinguished road
Default

I fix the problem like this in my websites:

Code:
// Vergroot div's hoogte wanneer een andere div hoger is
function changeDiv() {
	
	// Div's hoogte's
	var contentDiv    = document.getElementById('mainContent'); 
	var contentHeight = document.getElementById('mainContent').offsetHeight;
	var browserWindow = document.documentElement; 	
	var menuDiv       = document.getElementById('menu'); 
	
	// Client window
	var clientWindowHeight = browserWindow.clientHeight - 130;
	
	// Grootste hoogte?
	var size = Math.max(clientWindowHeight, contentHeight);
	
	// Set height
	//contentDiv.style.height = size+'px';
	//menuDiv.style.height = size+'px';
	
}

window.onload = changeDiv;
window.onresize = changeDiv;
Should be pretty simple even while the comment is in dutch (since im dutch)

The place where you see -130, is my height of the header. I design my sites like this:

- overall wrapper with optional BG

- header

- col 1
- col 2

- close wrapper

If you choose to use my code and dont get it, don't hestitate mailing me (jim at combined-minds.net)
__________________
Nunchaku! Who doesn't like martial arts? =)
Send a message via MSN to Jim Send a message via Skype™ to Jim
Jim is offline  
Reply With Quote