sorry moved this over to javascript forum, didn't mean to post 2x!
Hi guys, I'm trying to put the finishing touches on my website and could really use some help on this particular issue. My page includes background music with a javascript music player on the main page below an iframe that is used for all content and navigation of the site and so that the music doesn't reload each time a page is switched. There is another javascript to resize the iframe to fit the content, so that it will adjust to the various page heights. The problem I'm having now is that it won't resize until it loads all the content (which includes some sizeable flash etc) and it is freezing during the resize process. It does however begin playing the music before resizing the iframe, and generally locks up saying it is still loading the indexforinline.htm, though it never actually completes and resizes (although I can hear my flash content loading working correctly -- the iframe is just not resized). Then I simply have to reload the iframe by clicking refresh, and it will appear correctly (now that the content is loaded) I'm thinking that it is loading the content ( i can hear it) , but not resizing the iframe in time to display it. One thing I would like to do is not load the music player until the iframe is loaded and resized, but this will only solve the resize problems on the homepage (or so I assume, because I have the same resize problems when navigating to other pages, and have to refresh them as well to get them to resize the iframe and display correctly)
Here is the code involved with the index.htm:
//script to resize iframe to correct height depending on content
<script language="JavaScript">
<!--
function calcHeight()
{
//find the height of the internal page
var the_height=
document.getElementById('the_iframe').contentWindo w.
document.body.scrollHeight;
//change the height of the iframe
document.getElementById('the_iframe').height=
the_height;
}
//-->
</script>
</head>
<body bgcolor="#000000">
// Iframe loaded with indexforinline.htm containing all content and navigation
<p align="center">
<iframe width="1000" id="the_iframe"
onLoad="calcHeight();"
src="indexforinlinetest.htm"
scrolling="NO"
frameborder="0"
height="1">An iframe capable browser is
required to view the website.</iframe>
//background music player loaded to index.htm
<table align="right" border="0" cellspacing="0"cellpadding="0"><tbody><tr><td>
<div align="right">
<script language='JavaScript' src='musicplayer.js' type='text/javascript'></script></div>
<tr><td>
<p align="right"> </td></tr></tbody></table>
<script language="JScript" type="text/jscript" src="../NoIEActivate.js"></script>
</body>
Anything you guys can suggest to ensure that the iframe resizes and displays correctly without refreshing the iframe would be greatly appreciated!! Thanks!!