Jump to content
xisto Community
Sign in to follow this  
Kubi

Music Controls Help

Recommended Posts

I'm interested in adding "Music Controls" to my website. I have a button top corner that I'd like to make clickable. What I want to do is have my website play music, well, I know how to do that, but I want that button to pause/play the music, and I'd also like to to NOT start from the beginning of the song every time you load a new page. Does anyone know the code for this?

Share this post


Link to post
Share on other sites

Found this right away might have to do some tweaking to it but it should be what your want, unless you plan to design it in flash.

The images/code is here
http://forums.xisto.com/no_longer_exists/

<HTML><HEAD><TITLE>Free Scripts And Tools For Webmasters @ http://forums.xisto.com/no_longer_exists/ LANGUAGE="JavaScript">var musiccount=1;function playmusic(){document.spec.src="spec.gif";if ((musiccount > 10) || (musiccount < 1)){musiccount=1;}tracknumber();if (musiccount==1){document.all.music.src="1.mid";}if (musiccount==2){document.all.music.src="2.mid";}if (musiccount==3){document.all.music.src="3.mid";}if (musiccount==4){document.all.music.src="4.mid";}if (musiccount==5){document.all.music.src="5.mid";}if (musiccount==6){document.all.music.src="6.mid";}if (musiccount==7){document.all.music.src="7.mid";}if (musiccount==8){document.all.music.src="8.mid";}if (musiccount==9){document.all.music.src="9.mid";}if (musiccount==10){document.all.music.src="10.mid";}}function stopmusic(){document.spec.src="spec1.gif";tracknumber();document.all.music.src='';}function forwardmusic(){document.spec.src="spec.gif";musiccount++;if ((musiccount > 10) || (musiccount < 1)){musiccount=1;}tracknumber();if (musiccount==1){document.all.music.src="1.mid";}if (musiccount==2){document.all.music.src="2.mid";}if (musiccount==3){document.all.music.src="3.mid";}if (musiccount==4){document.all.music.src="4.mid";}if (musiccount==5){document.all.music.src="5.mid";}if (musiccount==6){document.all.music.src="6.mid";}if (musiccount==7){document.all.music.src="7.mid";}if (musiccount==8){document.all.music.src="8.mid";}if (musiccount==9){document.all.music.src="9.mid";}if (musiccount==10){document.all.music.src="10.mid";}}function rewindmusic(){document.spec.src="spec.gif";musiccount--;if ((musiccount > 10) || (musiccount < 1)){musiccount=1;}tracknumber();if (musiccount==1){document.all.music.src="1.mid";}if (musiccount==2){document.all.music.src="2.mid";}if (musiccount==3){document.all.music.src="3.mid";}if (musiccount==4){document.all.music.src="4.mid";}if (musiccount==5){document.all.music.src="5.mid";}if (musiccount==6){document.all.music.src="6.mid";}if (musiccount==7){document.all.music.src="7.mid";}if (musiccount==8){document.all.music.src="8.mid";}if (musiccount==9){document.all.music.src="9.mid";}if (musiccount==10){document.all.music.src="10.mid";}}function music1(){document.musicplayer.src="musicover.jpg";}function music2(){document.musicplayer.src="music.jpg";}</SCRIPT><div id="musiclayer" style="width:185px; height:92px;z-index:1;"><MAP Name="musicmap"><AREA SHAPE="RECT" COORDS="20,4,65,20" BORDER="0" onClick="playmusic()" onMouseOver="music1()" onMouseOut="music2()"><AREA SHAPE="RECT" COORDS="20,84,65,68" BORDER="0" onClick="stopmusic()"><AREA SHAPE="RECT" COORDS="63,24,81,65" BORDER="0" onClick="forwardmusic()"><AREA SHAPE="RECT" COORDS="2,24,21,65" BORDER="0" onClick="rewindmusic()"><AREA SHAPE="RECT" COORDS="83,84,0,92" BORDER="0" onClick="window.open('http://acejs.com; HREF="#"></MAP><IMG SRC="music.jpg" NAME="musicplayer" BORDER="0" USEMAP="#musicmap"><bgsound src="#" id=music loop=1 autostart="true"><IMG SRC="spec1.gif" name="spec" BORDER="0"><IMG SRC="0c.gif" name="number1" BORDER="0"><IMG SRC="0c.gif" name="number2" BORDER="0"><script LANGUAGE="JavaScript">function tracknumber(){if (musiccount==1){document.number1.src="0c.gif";document.number2.src="1c.gif";}if (musiccount==2){document.number1.src="0c.gif";document.number2.src="2c.gif";}if (musiccount==3){document.number1.src="0c.gif";document.number2.src="3c.gif";}if (musiccount==4){document.number1.src="0c.gif";document.number2.src="4c.gif";}if (musiccount==5){document.number1.src="0c.gif";document.number2.src="5c.gif";}if (musiccount==6){document.number1.src="0c.gif";document.number2.src="6c.gif";}if (musiccount==7){document.number1.src="0c.gif";document.number2.src="7c.gif";}if (musiccount==8){document.number1.src="0c.gif";document.number2.src="8c.gif";}if (musiccount==9){document.number1.src="0c.gif";document.number2.src="9c.gif";}if (musiccount==10){document.number1.src="1c.gif";document.number2.src="0c.gif";}}</SCRIPT></div><P><B><A HREF="http://http://www.acejs.com/; The JavaScript Directory</B></BODY></HTML>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.