Log in

View Full Version : Stop music dynamically



crowee
01-04-2006, 10:33 AM
I have a web page playing music automatically. At the bottom of this webpage I have the following code to allow a visitor to open a new window. NOTE: I like the " target="blank" " part of this code so that the visitor is eventually returned back to the page that sent him to the new window...but I need additional coding to stop the music from "bleeding through" to the new window. I think I need the ".stop()" function to dynamically stop the music from playing whenever the visitor elects to open this new window by clicking on the small thumnail photograph on the initial page. Can you help?


Here's my code---

<P align=right>
<b>Want to see more ? --- Go to <EM><STRONG>Grandkids </STRONG></EM>by pointing to and then clicking on --->>>&nbsp;&nbsp;</b>
<a href="http://york1952.tripod.com/hbrucedowneygrandkids.html"
target="blank"><img name="im" src="http://filebox.vt.edu/users/hdowney/HarvardJessKris91.jpg" border="0" title=" Go To Grandkids "/></a></P>

jscheuer1
01-04-2006, 05:53 PM
To stop the music, we need to know the code that you used to start it in the first place. I found a page on your site with a media player object/embed tag. If that is the media player you are using, then:


<a href="http://york1952.tripod.com/hbrucedowneygrandkids.html"
target="_blank" onclick="if(document.all&&!window.opera){document.getElementById('mediaplayer1').stop()} else{document.getElementById('mediaplayer1').style.display='none'};return true;"><img name="im" src="http://filebox.vt.edu/users/hdowney/HarvardJessKris91.jpg" border="0" title=" Go To Grandkids "/></a>

will do the trick. BTW, in an unrelated matter, the target part should be as I have it (target="_blank").