Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Adding Music on rollover

Options
  • 07-01-2011 7:48pm
    #1
    Registered Users Posts: 63 ✭✭


    Hi all

    Im looking for an easy way of adding a music clip on rollover of an image using dreamweaver and i can't find any videos or useful tutorials anywhere

    any suggestions?


Comments

  • Registered Users Posts: 3,579 ✭✭✭BopNiblets


    This seemed to work for me in FF only though.
    <script language="javascript" type="text/javascript">
     function playSound(soundfile) {
     document.getElementById("dummy").innerHTML=
     "<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />";
     }
     </script>
    
    <img src="playmusic.jpg" alt="Play music" onmouseover="playSound('music.mp3');">
    <span id="dummy"></span>
    


  • Closed Accounts Posts: 7,221 ✭✭✭BrianD


    You should check out if there are royalty payments required for the use of the music.


  • Closed Accounts Posts: 18,163 ✭✭✭✭Liam Byrne


    Also note that the above may cause a lag while the mp3 in question loads, which might spoil the effect.

    P.S. I'd hope this isn't for a key navigation element or something, and is for something specific where the user would expect a sound ? Because otherwise it would be extremely irritating, particularly if the sound restarts every time you roll over a navigation element.


Advertisement