PDA

View Full Version : ie8 does not immediately utilize js



james438
09-01-2011, 08:56 AM
Hi,

The script is designed with help from this forum to vertically align the scripture verse between the logo and the tabs below.

Please excuse the posting of a link rather than the specific code involved, but I have the following page http://www.sovgraceopc.org/test2.php that seems to work in the browsers I have on my desktop, but in ie8 the script does not seem to work unless the browser is resized.

Is there a way to get this to work immediately in ie8 without having to resize the window first?

jscheuer1
09-01-2011, 10:47 AM
<script type="text/javascript">
onload = onresize = function(){
var r = document.getElementById('resizable');
r.style.height = r.parentNode.offsetHeight - r.parentNode.getElementsByTagName('div')[0].offsetHeight + 'px';
};
</script>
<!--[if IE]>
<script type="text/javascript" defer>
onload();
</script>
<![endif]-->

james438
09-01-2011, 01:06 PM
Awesome, thanks :)