1. Dashboard
  2. Artikel
  3. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Dieses Thema
  1. HTML - Webmaster Forum
  2. HTML / Webmaster Forum
  3. HTML & CSS Forum

Sound (?)

  • Foulfang
  • 1. Oktober 2003 um 10:23
  • Foulfang
    Großmeister(in)
    Beiträge
    412
    • 1. Oktober 2003 um 10:23
    • #1

    Guten Tag

    Also ich hab folgende, etwas kompliziert zu erklärende Frage:

    Ich möchte, dass der User Sound auf meiner Website hören kann wenn er möchte. Dies soll geschehen in dem er auf diesen Button im Menue klickt:

    [Blockierte Grafik: http://mitglied.lycos.de/africanreptile…croll_menue.jpg]

    Aber wie löse ich das am Besten. Ich habe keinen Plan wie ich das anstellen soll. Kann mir eventuell jemand helfen? Der Quelltext des Menue ua. findet ihr hier:

    http://www.price-reptiles.com/NinjaScroll/home.htm

    Das wäre wirklich super nett, denn dann wäre ich meinem Ziel wieder etwas näher! ;)

  • Foulfang
    Großmeister(in)
    Beiträge
    412
    • 1. Oktober 2003 um 11:57
    • #2

    Sorry das Doppelposting aber hab eben eine Lösung gefunden. Ich hoffe sie funktioniert auch auf allen Browsern. Wie dem auch sei, ich bin natürlich immer noch nicht zufrieden. *g* Und zwar möchte ich dass wenn man nochmals auf das Symbol (Das vom Bild oben) klickt, der Sound aufhört. Sprich: Wenn man das erste mal draufklickt, beginnt der Sound, wenn man nochmals draufklickt stellt er ab.

    Verwenden tue ich folgendes (Java)Script:

    Im Header:

    Code
    <script LANGUAGE="JavaScript"><!--
    // Preload and play audio files with event handler (MouseOver sound)
    // designed by JavaScript Archive, (c)1999
    // Get more free javascripts at http://jsarchive.8m.com
    
    
    var aySound = new Array();
    // Below: source for sound files to be preloaded
    aySound[0] = "laser.wav";
    
    
    // DO NOT edit below this line
    document.write('<BGSOUND ID="auIEContainer">')
    IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
    NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
    ver4 = IE||NS? 1:0;
    onload=auPreload;
    
    
    function auPreload() {
    if (!ver4) return;
    if (NS) auEmb = new Layer(0,window);
    else {
    Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
    document.body.insertAdjacentHTML("BeforeEnd",Str);
    }
    var Str = '';
    for (i=0;i<aySound.length;i++)
    Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
    if (IE) auEmb.innerHTML = Str;
    else {
    auEmb.document.open();
    auEmb.document.write(Str);
    auEmb.document.close();
    }
    auCon = IE? document.all.auIEContainer:auEmb;
    auCon.control = auCtrl;
    }
    function auCtrl(whSound,play) {
    if (IE) this.src = play? aySound[whSound]:'';
    else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
    }
    function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
    function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }
    //-->
    </script>
    Alles anzeigen

    Button:

    Code
    [url='javascript:playSound(0);']Button[/url]

    Wäre super wenn jemand mir helfen könnte!!

  • Foulfang
    Großmeister(in)
    Beiträge
    412
    • 2. Oktober 2003 um 10:46
    • #3

    Damit mein Thread nicht ganz sinnlos ist und da ich jetzt weiss wie das möglich ist, möchte ich hier noch die Lösung posten, falls jemand das gleiche Problem hat:

    Im Header:

    Code
    <script LANGUAGE="JavaScript"><!--
    // Preload and play audio files with event handler (MouseOver sound)
    // designed by JavaScript Archive, (c)1999
    // Get more free javascripts at http://jsarchive.8m.com
    
    
    var aySound = new Array();
    // Below: source for sound files to be preloaded
    aySound[0] = "sound/sound.mid";
    
    
    // DO NOT edit below this line
    document.write('<BGSOUND ID="auIEContainer">')
    IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
    NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
    ver4 = IE||NS? 1:0;
    onload=auPreload;
    
    
    function auPreload() {
    if (!ver4) return;
    if (NS) auEmb = new Layer(0,window);
    else {
    Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
    document.body.insertAdjacentHTML("BeforeEnd",Str);
    }
    var Str = '';
    for (i=0;i<aySound.length;i++)
    Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='false' HIDDEN='true'>"
    if (IE) auEmb.innerHTML = Str;
    else {
    auEmb.document.open();
    auEmb.document.write(Str);
    auEmb.document.close();
    }
    auCon = IE? document.all.auIEContainer:auEmb;
    auCon.control = auCtrl;
    }
    function auCtrl(whSound,play) {
    if (IE) this.src = play? aySound[whSound]:'';
    else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
    }
    function playSound(whSound) 
    {
      document.getElementById('soundlink').href="javascript:stopSound(0)";
      if (window.auCon) auCon.control(whSound,true); 
    }
    
    
    function stopSound(whSound) 
    {
      document.getElementById('soundlink').href="javascript:playSound(0)";
      if (window.auCon) auCon.control(whSound,false); 
    }
    //-->
    </script>
    Alles anzeigen

    Button:

    Code
    [url='javascript:playSound(0)']Button[/url]


    MfG,

  • del
    Youngster
    Beiträge
    18
    • 13. Oktober 2003 um 18:55
    • #4

    die einfachste loesung ist eine kleine flashdatei zu nehmen.

    die muss nur aus den buttons fuer die musik bestehen. da gibt es auch fertige sachen, zb bei flashkit

    gruesse
    del

    •••••j-pop.de•••••
    anime musik und jpop

Tags

  • www
  • browser
  • button
  • html
  • http
  • style
  • super
  • jpg
  • ton
  • quelltext
  • java
  • img
  • code
  • lycos
  • mitglied
  • bild
  • website
  • div
  • javascript
  • position
  • htm
  • sound
  • scroll
  • script
  • header
  • layer
  • klickt
  • menue
  1. Datenschutzerklärung
  2. Impressum
Community-Software: WoltLab Suite™
  • Alles
  • Dieses Thema
  • Dieses Forum
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche