I have a problem with finding the right way to get one of the music pieces to play when the visitor clicks (or hovers) over the text.
The site is: http://www.pianomusic4u.net/newindex.html (without sound) where I do my coding, and final page is the identical home site at: http://www.pianomusic4u.net (with background sound at the moment but should only be played when the title is clicked). Not all the music pieces are loaded as yet in the code, but if I know how to do pieces 1 and 2, then I can copy it into the locations 3 to 6.
Any help would be greatly appreciated, since I have already tried nearly everything I can think of over the last 5 days. (May be that is not enough....
There also seems to be an error in the functions PlayMusic1() and PlayMusic2() .
Thanks in advance for all your help.
Regards,
Ronald.
Code:
<p align="center"><font color="#0000FF" size="5"><a href="#1"><onmouseup="PlayMusic1()">Prelude No 1 By J.S. Bach</a>
<a href="#2"><onmouseup="PlayMusic2()">Feelings</a>
</font></p>
<script language="javascript"><!--
function PlayMusic1(){
<a><embed src="http://www.pianomusic4u.net/music/Feelings.wmv" width="144" height="60" autostart="true" loop="false" hidden="true">
</embed></a>
}
/--></SCRIPT>
<script language="javascript"><!--
function PlayMusic2(){
<a><embed src="http://www.pianomusic4u.net/music/Prelude1.wmv" width="144" height="60" autostart="true" loop="false" hidden="true">
</embed></a>
}
/--></SCRIPT>