PDA

View Full Version : javascript, at LEAST a certain height...


colfaxrev
10-10-2006, 10:58 AM
i've got this working for IE, and FF. I haven't tested Nescape yet, but I know that safari on a mac doesn't work.

http://www.triotalentagency.com/newsite/

What the javascript is doing is, checking the windows inner height, and checking to see if thats bigger or smaller or the same as the minimum height, then modifies the flash object to be the correct size.

Here's my code...


<script language="javascript">
// <![CDATA[
function updatePage()
{
var newHeight = 20;
if (navigator.appName=="Netscape")
{
if (window.innerHeight < 850)
{
newHeight = 850;
}
else
{
newHeight = window.innerHeight;
}
}
else if (navigator.appName.indexOf("Microsoft")!=-1)
{
if (document.body.clientHeight < 850)
{
newHeight = 850;
}
else
{
newHeight = document.body.clientHeight;
}
}
else
{
document.write("JAVASCRIPT ERROR!!!! MISSING BROWSER IF STATEMENT!");
}
document.fo.height=newHeight;
}
// ]]>
</script>


it's weird that the document.write thing doesn't seem to do anything!!!

am i using this wrong?

btw... the 850 number is actually a var in php thats printed out. im not actually typing that out that many times in my code.

any help would be greatly appreciated!