473,786 Members | 2,405 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="JavaS cript"><!--
function musicOff() {
document.midi.s top()
}function musicOn() {
document.midi.p lay()
}
function changeButton() {
if (document.onoff .B1.value=='Tur n 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="change Button()" style="color: #000000; background-color: #FFFFFF;
font-family: Tahoma; font-size: 10pt">
</form>

---------------------------------------------------
--
Gaffer
Sep 18 '05 #1
1 12331
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="fals e"

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

--
Randy
comp.lang.javas cript 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
2496
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 file. I have a "Play" button. I know how to get to a section of code when the user clicks that button. Question 1: What do I have to do to make it play on the the user's machine when he clicks the "Play" button. Question 2: When he...
20
4431
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 new pages from its links. Although that's the only solution that I know of. Does anyone have another solution?
5
1813
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. However, I don't want them to be able to download the songs that they are listening to from my site. What would the best means of accomplishing this?
14
4016
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 the site moves to a different page the music starts again. The artist would like the music to play continuously. I can only think of three possible ways to solve this, and I am not happy with any of them.
2
1751
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 SEO. Is it possible to achieve it via cookies/sessions?
0
909
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 problem I'm having is to create multiple PictureBoxes for every key that I press. I wish that whenever I press a key a new picturebox is created and the note picture is displayed in it. I need some help with the code though... I have a Panel with 6...
11
2185
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 filelistbox so the user can choose the drive his music is on then find the folder the music is in and if others are like me you have so much music it takes for ever to find the artist or song you are looking for so i made a button that searchs the filelistbox...
7
2906
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 being able to download'. Player doesn't have to have visible controls. Just a Play button is enough (that too controlled by JS) Not a solution then some pointer towards how to start with?
2
4413
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 the native PlaySound function but the results were the same. Any ideas how to have a background music and a button sound without using DirectSound? Can you provide me some snippets?
0
9647
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9492
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10163
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10108
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9960
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3668
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.