Results 1 to 3 of 3

Thread: Looking for a script

  1. #1
    Join Date
    Jul 2005
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Looking for a script

    I want a script that generates a sound on mouse rollover ie.. mouse over
    nav. buttons.

    Is ther a script?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    http://www.dynamicdrive.com/dynamici...criptsound.htm

    That's for IE only. I devised a script that works in Mozilla as well:
    Code:
    <html>
    <head>
    <title>Cross Browser Sound - Demo</title>
    <style type="text/css">
    .snd {
    height:0;
    width:0;
    position:absolute;
    top:0;
    left:0
    }
    </style>
    <script type="text/javascript">
    /*Cross Browser Sound Script
      Copyright © John Davenport Scheuer
      Permission granted for use
      This credit must stay intact*/
    //////////No need to Edit Script/////////
    function e_sound(soundobj) {
    if((!document.all)&&(document.getElementById)){
      var thissound= eval("document."+soundobj);
      thissound.Play();
    }
    else if(document.all){
    var a=eval("document.all."+soundobj+".src");
    document.all.sound.src=a;
    }
    else
    return;
    }
    </script>
    </head>
    <body onfocus="if(document.all)document.all.sound.src=''">
    <bgsound id="sound">
    <!--edit below embeds to add different SRC sounds or add more,
    use a unique name for each embed-->
    <embed class="snd" NAME="chm" SRC="chimes.wav" AUTOSTART="false" loop="false" HIDDEN="true">
    <embed class="snd" NAME="dng" SRC="ding.mp3" AUTOSTART="false" loop="false" HIDDEN="true">
    <embed class="snd" NAME="thp" SRC="thup.wav" AUTOSTART="false" loop="false" HIDDEN="true">
    <!--use with any element that supports onMouseOver, onMouseOut or onClick events-->
    <span onmouseOver="e_sound('chm')" onmouseOut="e_sound('dng')">Mouse Over This for Chime, Mouse Out for Ding</span>
    <br><a href=// onmouseOver=e_sound('thp')>Thup!</a>
    </body>
    </html>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2005
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks John

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •