Forum Moderators: open
<html>
<head>
<title>Parent frame page</title>
</head>
<frameset cols="100%,*">
<frame src="Universal_Home_page.htm" name="fr_home"/>
<frame src="Universal_sound_page.htm" name="fr_sound"/>
</frameset>
</html>
On the sound page I've got
<body onload="parent.fr_home.startAnnimation()">
The parent.fr_home.startAnnimation() command on the sound page works great. It starts the annimation after both pages have loaded and that's what I want.
The problem is, while the pages are loading it's a traffic jam with both pages trying to load first. Is there a way to specify the loading order with the home page loading first.
// This code goes in the parent frameset
var loadedFrames = new Array();
function frameLoaded( idref )
{
loadedFrames[loadedFrames.length] = idref;
}
function isFrameLoaded( idref )
{
for( var i = 0; i < loadedFrames.length; i++ )
{
if( loadedFrames[i] == idref ) return true;
}
return false;
}
Then on your "home" frame, you would do:
body onload="parent.frameLoaded('fr_home');"
And on your animation page, you would have some polling function that called parent.isFrameLoaded('fr_home') until it returned true, at which point you would then know the home frame was loaded. Probably using setTimeout() or setInterval().
Hope that helps.