|
|
background sound | ||
Discussion by suicide with 4 Replies.
Last Update: March 5, 2008, 2:20 pm | |||
As part of my college work I have produced a web page, that as to include dertain elements: meta tag info, internal + external link, images, text One audio clip, and one video clip, use of frames and a no frames option, one input form, and to demonstrates the use of a template.
The problem is, I thought I had everything covered, and recieved some negative feedback, which I don't mind, but the problem is I know the music is annoying (no one more than me does) but until my tutor grades my work there it stays. So how can I make it so that it turns off (like a button or something) here is the code
<bgsound src="blackhole.mid" loop="3">
Here is the website
www.carbootersheaven.co.uk
Please take a look, this is my first attempt and I really don't want to submit my work if it aint right
Thanks
The problem is, I thought I had everything covered, and recieved some negative feedback, which I don't mind, but the problem is I know the music is annoying (no one more than me does) but until my tutor grades my work there it stays. So how can I make it so that it turns off (like a button or something) here is the code
<bgsound src="blackhole.mid" loop="3">
Here is the website
www.carbootersheaven.co.uk
Please take a look, this is my first attempt and I really don't want to submit my work if it aint right
Thanks
Tue Sep 7, 2004 Reply New Discussion
ok this is my code for you. i will explain as good as i can
This code is to embed the sound onto the page. the loop value makes the sound loop until it is stopped. the autostart value is there so it starts when the page loads and the hidden value is there to keep the sound from showing up on the webpage visually. the MASTERSOUND is there to say that this is the top level sound, if you hade many sounds on the webpage.:
loop="true" hidden="true" autostart="true" mastersound>
To stop the background music you can call the:
method. This method is cross-browser compatible... i think. The "document" refers to the webpage the music is on. the "BlackHole" refers to the embedded sound, which it locates through the NAME tag in the embed tag. and the "STOP()" part stops the sound.
To call this from a text link use this code:
>Stop Music</a>
For a button use this:
If you need anymore help or if something doesnt work just post.
This code is to embed the sound onto the page. the loop value makes the sound loop until it is stopped. the autostart value is there so it starts when the page loads and the hidden value is there to keep the sound from showing up on the webpage visually. the MASTERSOUND is there to say that this is the top level sound, if you hade many sounds on the webpage.:
CODE
<embed name="BlackHole" src="blackhole.mid"loop="true" hidden="true" autostart="true" mastersound>
To stop the background music you can call the:
CODE
document.BlackHole.stop()method. This method is cross-browser compatible... i think. The "document" refers to the webpage the music is on. the "BlackHole" refers to the embedded sound, which it locates through the NAME tag in the embed tag. and the "STOP()" part stops the sound.
To call this from a text link use this code:
CODE
<a href="#" onClick="document.bgSound.stop(); return false;">Stop Music</a>
For a button use this:
CODE
<input type="button" value="Stop Music" onclick="document.bgSound.stop(); return false;">If you need anymore help or if something doesnt work just post.
Tue Sep 7, 2004 Reply New Discussion
hey thanks but wont it be easy for newebies like me to just use FLash it can put ur music to site with not diffficulty.But thanks for the code will give it a try
Wed Sep 8, 2004 Reply New Discussion
You could use flash but if you require something like suicide needs then this is a good and simple way to do it, the only way i know of. I don't think it is that hard to figure out what the code does, even for a "newbie".
Wed Sep 8, 2004 Reply New Discussion
Background sound is one of the most trickiest things of web development. This is because
1. A cross-browser, valid XHTML method is hard to implement.
2. It is considered to be annoying as users may not like it.
However, with valid (X)HTML, you can use <object> I suppose, but it doesn't work as well in Internet Explorer. You can workaround that with a conditional comment. Here is the code:
<!--[if IE]><bgsound loop="3" src="basdanse.mid" /><![endif]-->
1. A cross-browser, valid XHTML method is hard to implement.
2. It is considered to be annoying as users may not like it.
However, with valid (X)HTML, you can use <object> I suppose, but it doesn't work as well in Internet Explorer. You can workaround that with a conditional comment. Here is the code:
CODE
<object data="soundfile.mid" codetype="audio/mid"></object><!--[if IE]><bgsound loop="3" src="basdanse.mid" /><![endif]-->
Wed Mar 5, 2008 Reply New Discussion
password protection thing (2)
|
(7) putting a background color makes a slight problem
|
Index




