PDA

View Full Version : Audio on web pages!


mattsaunders
06-07-2004, 07:05 AM
Hi there I am making a djing website for a friend and I have got a music sample playing through the site.

I was told to have the music in a frameset which meant that I can navigate the site with the sample restarting.

The only problem that I have found with this is that when I navigate to another website the music still plays.

I have heard on other sites that when you move to another website the music stops.

How do I do the same.

Cheers :)

agent002
06-07-2004, 08:26 AM
I can only think of one option; some JavaScript. Put this code between the <head> and </head> tags of the frameset page:
<script type="text/javascript">
window.onunload = function(){
window.frames['hiddenFrame'].document.getElementById('bgMusic').src = '';
}
</script>
That script assumes that the name of the hidden frame is "hiddenFrame", and that the embed in it has the id "bgMusic". Change the names/ids if you want.

mattsaunders
06-07-2004, 08:37 AM
Hi there thanks for answering my post.

I tried that did not work here is the content of my framset page

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>djandynelson</title>


</head>

<frameset cols = "100%, 0.2%">
<frame src ="intro.html" />
<frame src ="music.html" />
</frameset>

<body>

</body>
</html>

What Am I doing wrong? :(