![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Web Design & Programming Discussion of web design, and server-side & client-side scripting |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Mar 2008
Posts: 20
OS: winXP Home Edition SP2
|
Put sound to the Site
I'm putting my daughters site together and I want the music to play when your on the main page....How doI get this...I'm using Dream Weaver....
http://jourdest.com |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#2 (permalink) |
|
Design Team Member
Join Date: Jul 2007
Location: Coventry, UK
Posts: 1,876
OS: Vista, various linux distros
|
Re: Put sound to the Site
in dreamweaver:
1) get into code view 2) underneath the "<body>" tag insert: "<bgsound src='filename.mp3'>" I think that should work, If not post back and say so and i'll write something proper to do it. Last edited by jamiemac2005; 04-23-2008 at 02:50 PM. |
|
|
|
|
|
#4 (permalink) |
|
Registered User
Join Date: Apr 2008
Location: Oklahoma City
Posts: 26
OS: xp(sp2), OSX(10.5)
|
Re: Put sound to the Site
if microsoft would ever produce a web standard compliant browser all you should need is: (will work for firefox & safari)
<object data="TheWhiteStripes-Conquest.mp3" type="audio/mpeg" title="Title of song"> <param name="autostart" value="true"> <param name="hidden" value="true"> </object> being that the current stuff is horrible to develop for this should work: (make sure to not leave spaces or exotic characters in the mp3 name) <div style="visibility:hidden;"> <object data="TheWhiteStripes-Conquest.mp3" type="audio/mpeg" title="Title of song"> <param name="autostart" value="true"> <param name="hidden" value="true"> </object> <bgsound id="bgsound_id" loop=1 src="TheWhiteStripes-Conquest.mp3" type="audio/mpeg"> <embed name="guitar" src="TheWhiteStripes-Conquest.mp3" loop=false autostart=false hidden=true type="audio/mpeg" mastersound> </div> <script language="JavaScript"> <!-- if (window.XMLHttpRequest) { // IE 7, mozilla, safari, opera 9 if(navigator.appVersion.indexOf("MSIE 7.")==-1) self.document.guitar.play() } else { // IE6, older browsers self.document.guitar.play() } //--> </script> Last edited by snowman7000; 04-23-2008 at 10:52 PM. Reason: took out dead code |
|
|
|
|
|
#5 (permalink) |
|
Registered User
Join Date: Apr 2008
Location: Oklahoma City
Posts: 26
OS: xp(sp2), OSX(10.5)
|
Re: Put sound to the Site
I guess I could tell you how it works: I will only go through the second one since it is what you most likely use if you go this way. Web compliant browsers will ignore the stuff below the </object> since it is all either proprietary or depreciated.
This part is used by firefox, safari and other w3 standards based web browsers, this is ignored by IE6 and IE7 <object data="TheWhiteStripes-Conquest.mp3" type="audio/mpeg" title="Title of song"> <param name="autostart" value="true"> <param name="hidden" value="true"> </object> This part loads the songs, but microsoft does not allow songs to start paying automaticaly if you try it will not and the browser will warn that your have an active x control and have the yellow bar at the top <bgsound id="bgsound_id" loop=1 src="TheWhiteStripes-Conquest.mp3" type="audio/mpeg"> <embed name="guitar" src="TheWhiteStripes-Conquest.mp3" loop=false autostart=false hidden=true type="audio/mpeg" mastersound> The two parts above were wrapped in div tags because some browsers try to display a control their but can not so usually will display what was in that area from the last webpage that was their This script is just a work around the fact that microsoft does not trust their own controls (probably with good reason they should never have allowed access to active x through browsers but i digress). Most newer versions of IE will not start if you tell it to play automatically, but a milliseconds later it is ok with. <script language="JavaScript"> <!-- if (window.XMLHttpRequest) { // IE 7, mozilla, safari, opera 9 if(navigator.appVersion.indexOf("MSIE 7.")==-1) self.document.guitar.play() } else { // IE6, older browsers self.document.guitar.play() } //--> </script> |
|
|
|
|
|
#6 (permalink) | |
|
Registered User
Join Date: Mar 2008
Posts: 20
OS: winXP Home Edition SP2
|
Re: Put sound to the Site
Quote:
snowman7000 idea probably will work ...I just have to figure out what to takeout and add so it will play the song I want....the src is http://jourdest.com/mp3/music/Bayou.mp3 Last edited by tandd6; 04-24-2008 at 09:15 PM. |
|
|
|
|
|
|
#7 (permalink) | |
|
Design Team Member
|
Re: Put sound to the Site
Quote:
__________________
Free Resources PC Protection - Comodo Firewall | AVG Anti-Virus | WinPatrol | Ad-Aware | Spybot S&D | SpywareBlaster |Web Design/Programming - KompoZer (Editor) | Paint.NET (Graphic) | GIMP+GIMPShop (Graphic) | FileZilla (FTP Client) | Free Hosting | |
|
|
|
|
|
|
#8 (permalink) |
|
Registered User
Join Date: Apr 2008
Location: Oklahoma City
Posts: 26
OS: xp(sp2), OSX(10.5)
|
Re: Put sound to the Site
All you need to do is change the file path/names, anything else is optional but I would recommend putting everything after the colon together just before the </body> tag so it will work in most cases 90% to 95% of the time I would expect (antiquated browsers or javascript disabled being the limiting factors):
<div style="visibility:hidden;"> <object data="http://jourdest.com/mp3/music/Bayou.mp3" type="audio/mpeg" title="Born on the Bayou - Creedence Clearwater Revival"> <param name="autostart" value="true"> <param name="hidden" value="true"> </object> <bgsound id="bgsound_id" loop=1 src="http://jourdest.com/mp3/music/Bayou.mp3" type="audio/mpeg"> <embed name="guitar" src="http://jourdest.com/mp3/music/Bayou.mp3" loop=false autostart=false hidden=true type="audio/mpeg" mastersound> </div> <script language="JavaScript"> <!-- if (window.XMLHttpRequest) { // IE 7, mozilla, safari, opera 9 if(navigator.appVersion.indexOf("MSIE 7.")==-1) self.document.guitar.play() } else { // IE6, older browsers self.document.guitar.play() } //--> </script> |
|
|
|
|
|
#9 (permalink) | |
|
Registered User
Join Date: Mar 2008
Posts: 20
OS: winXP Home Edition SP2
|
Re: Put sound to the Site
Quote:
|
|
|
|
|
|
|
#10 (permalink) |
|
Registered User
Join Date: Apr 2008
Location: Oklahoma City
Posts: 26
OS: xp(sp2), OSX(10.5)
|
Re: Put sound to the Site
I wish you and your family the best!
If you want learn about web development I would recommend w3schools's site: the HTML, CSS and the JavaScript would be the first sections I would recommend you look into. They have pretty well written tutorials and examples over many web related subjects, and are set up so you can edit the examples to see what changes will do. |
|
|
|
![]() |
| Thread Tools | |
|
|