Change height of div element if < window height
Hi!
I'm a comlete idiot when it comes to javascript and dom structure.
What i'm trying to do is to change a absolute positioned <div>'s height to browser window height if the div's height is lesser than the window height.
I'm currently using this function to retrive window height.
function get_windowHeight()
{
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' )
{ //Non-IE
myHeight = window.innerHeight;
}
else
{
if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
{ //IE 6+ in 'standards compliant mode'
myHeight = document.documentElement.clientHeight;
}
else
{
if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
{ //IE 4 compatible
myHeight = document.body.clientHeight;
}
}
}
return myHeight;
}
Anoone how can give me a pointer how to move from here?
Very cratefull for answers
/ Joel Junström
|