473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Music on/off button

Is it possible to change the following code so that the music is 'off' when
the page is loaded and the user gets the option to turn it on?

---------------------------------------------------
<script language="JavaScript"><!--
function musicOff() {
document.midi.stop()
}function musicOn() {
document.midi.play()
}
function changeButton() {
if (document.onoff.B1.value=='Turn music off') {
document.onoff.B1.value='Turn music on';
musicOff()
}
else {
document.onoff.B1.value='Turn music off';
musicOn()
}
}
//-->
</script><embed name="midi" src="psychotune.mp3" width="95" height="95"
hidden>
<form name="onoff">
<input type="button" value="Turn music off" name="B1"
onClick="changeButton()" style="color: #000000; background-color: #FFFFFF;
font-family: Tahoma; font-size: 10pt">
</form>

---------------------------------------------------
--
Gaffer
Sep 18 '05 #1
1 12306
Gaffer said the following on 9/18/2005 8:31 AM:
Is it possible to change the following code so that the music is 'off' when
the page is loaded and the user gets the option to turn it on?
<--snip-->
<embed name="midi" src="psychotune.mp3" width="95" height="95"
hidden>


autostart="false"

alt.html and comp.info.www.authoring.html are that way ======>

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Sep 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Shelly | last post by:
I have a list of file descriptions in a list box that is filled via a php mysql select. I know the name of the file that is described by the file that is select from that list box. It is an audio...
20
by: gallery | last post by:
Our client insists on having a music loop playing as the visitor travels throughout his new HTML website. We will not be doing this in frames and I would prefer not to have the home page spawn...
5
by: gregrjones | last post by:
I'm a musician who has a web site. I'd like to provide visitors of my web site with the means of streaming music off of my web site as one would if they were listening to a radio station. ...
14
by: gnarl | last post by:
Hello all, I'm developing a site in PHP4 for a music artist, who wants music to play across all their pages. I have loaded a simple flash applet to play the music, but every time the visitor to...
2
by: Suresh P | last post by:
Hi All, Is there any way other than frames to play music in the background of the website without restart while navigating to different pages of the website. Because, frames will affect the...
0
by: xoqqa | last post by:
I have an assignment that requires me to build a Simple Music Editor. One of the tasks is that when I press a button (music key) the program will display the music note in a Music Staff. The...
11
by: sniperelite | last post by:
i had to create a program for a programming class final, it breaks dow like this. i have 2 textboxes for user input, a drivelistbox which is linked to a dirlistbox which is also linked to a...
7
hsriat
by: hsriat | last post by:
Please suggest me a decent music player. My requirements are: JavaScript is able to add songs to the playlist dynamically. JavaScript can select which song to play. I don't care for 'music not...
2
by: ventsislav | last post by:
I want to have a background music to my simple app and a buton which plays another sound, but when I press the button the sound from it interrupts the background sound. I tried with SoundPlayer and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.