I'm working on a program that needs to set all objects height according the phone screen height.
Main screen has a table with this settings:
Code: Select all
<table width="100%" border="0">
<tr>
<td> </td>
<td height="300" id="largo" colspan="7" bgcolor="#CCCCFF">
<iframe id="iframe" src="load.php" height="100%" width="100%"></iframe>
</td>
<td> </td>
</tr>
...
...
I need to resize it dinamically.
the easy way i found to do this is:
a) Set the <body> tag as:
Code: Select all
<body onload="getlarge();">
Code: Select all
<script>
function getlarge(){
document.getElementById("largo").height=(window.innerHeight-240);
}
</script>
You can use this as factor (window.innerHeight * 0.65) or as you need
Enjoy it!
David de Argentina