Forum Moderators: open

Message Too Old, No Replies

Frames. Pages downloading onto viewers computer.

Pages for both frames want to load first.

         

Adam5000

2:47 pm on Mar 26, 2006 (gmt 0)

10+ Year Member



I’m using background sound on my pages and to make the music play continuously without restarting when a viewer goes to a new page I’m using frames. And below is the code for the frames page. I put the home page in frame one at 100% and the sound page (with only music) in frame 2 at 0%. That works but it’s a traffic jam when it comes to downloading the pages to the viewer’s computer. Both pages want to load first. This normally wouldn’t be a problem as long as both pages eventually load but on the home page (frame one) I’ve got animation linked to the onload event. After the onload event on the home page occurs, the animation starts. The music file (called for on the sound page in frame two) is larger than all the files on the home page added together and it always takes longer to load. So the animation starts before the music.
Is there a way I can specify which page loads first?
Another thought I had is using a preloader on the home page (frame one) to load the music file called for on the sound page (frame two).

<html>
<head>
<title>Frames page</title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<meta content="MSHTML 6.00.2900.2802" name="GENERATOR" />
</head>

<frameset cols="100%,*">
<frame src="MSIE_Home_page.htm" />
<frame src="MSIE_sound.htm" />
</frameset>
</html>

Help!

kaled

3:27 pm on Mar 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need to do something like this...

<frameset cols="100%,*" onload="loadSound(); return true;">
<frame src="MSIE_Home_page.htm" />
<frame src="blank.html" name="fr_sound"/>
</frameset>
</html>

function loadSound(){
fr_sound.location.replace('sound.html');
}

The details may not be quite right, but you should be able to make it work.

Kaled.

Adam5000

4:14 pm on Mar 29, 2006 (gmt 0)

10+ Year Member



That sounds like a good idea and I've tried several combinatons but I don't know what the code fr_sound.location.replace does.
Help!

kaled

6:07 pm on Mar 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The page blank.html MUST EXIST. It must be loaded into the frame that is to control sound. I called that frame fr_sound (refer to the frameset declaration).

fr_sound.location.replace('sound.html');

causes the page sound.html to be loaded into the frame fr_sound. It does so in a way that doesn't break the user's back button.

I can't remember where you put the javascript in a frameset, but other than that, I think you've got everything you need to make this work.

Kaled.

Adam5000

9:38 pm on Mar 29, 2006 (gmt 0)

10+ Year Member



Thank you Kaled. I rearranged a few of the details and it works just right. The sound page waits for the home page to load. The home page loads and then the sound page loads after that. And that's just right. Before it was like a big traffic jam with everything trying to load first. Hats off to you on a great job.