
January 18th, 2005, 11:11 AM
|
|
Contributing User
|
|
Join Date: Jun 2004
Posts: 50
Time spent in forums: 22 m 35 sec
Reputation Power: 5
|
|
|
javascript in frames
I have a page using frames in order to give the ability to have music played uninterrupted through out the navigation of the site. The music is located in music.html and I have buttons in main.html that I want to be able to turn the music off.
Code:
<FRAMESET rows="1,*" FRAMESPACING="0" BORDER="0">
<FRAME SRC="music.html" NAME="top" marginwidth="0" marginheight="0" scrolling="no" frameborder="no" noresize>
<FRAME SRC="main.html" NAME="main" marginwidth="0" marginheight="0" scrolling="yes" frameborder="no" noresize>
<noframes>
main page content
buttons here
</noframes>
this is the javascript that I had before I added frames to the site
Code:
<script>
function EvalSound(soundobj) {
var thissound=document.getElementById(soundobj);
thissound.Play();
}
function EvalSound2(soundobj) {
var thissound=document.getElementById(soundobj);
thissound.Stop();
}
</script>
this is my buttons
Code:
<form>
<input id="1" type="button" onClick="EvalSound('song')">
<input id="2" type="button" onClick="EvalSound2('song')">
</form>
how should I change this script so that it will work with frames, where should I put the script too?
|