Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Feb 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to play a sound when someone puts their mouse over an image ?

    Hi ,
    i need to know how to play a sound when someone puts their mouse over an image. I am using dreamweaver 8 and have no clue. please help me and i will nominate you as best member!

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,662
    Thanks
    6
    Thanked 1,006 Times in 979 Posts

  • #3
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,182
    Thanks
    174
    Thanked 257 Times in 257 Posts
    well if you need it, here is some JS and html you can try

    Code:
    <script>
    function EvalSound(soundobj) {
      var thissound= eval("document."+soundobj);
      thissound.Play();
    }
    </script>
    html

    Code:
    <embed src="success.wav" autostart=false width=0 height=0 name="sound1"
    enablejavascript="true">
    then the link

    Code:
    <a href="#" onMouseOver="EvalSound('sound1')">Move mouse here</A>
    that will do it!!

    good luck

  • #4
    Regular Coder
    Join Date
    Feb 2008
    Location
    Australia baby!
    Posts
    143
    Thanks
    6
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by jcdevelopment View Post
    well if you need it, here is some JS and html you can try

    Code:
     
    <script>
    function EvalSound(soundobj) {
      var thissound= eval("document."+soundobj);
      thissound.Play();
    }
    </script>
    html

    Code:
    <embed src="success.wav" autostart=false width=0 height=0 name="sound1"
    enablejavascript="true">
    then the link

    Code:
    <a href="#" onMouseOver="EvalSound('sound1')">Move mouse here</A>
    that will do it!!

    good luck
    Nice work JC. He wanted the sound when the mouse goes over an image tho
    Code:
     
    <img src="whatever" height="etc" width="etc" OnMouseOver="EvalSound('sound1')">
    outseeker - http://outer.reaches.dyndns.org/index.php
    I hope this helped someone. Due to this forums lame rep system penalising me for nothing, and admins inability to do anything about it, I'm sorry to say I will no longer be online here. Pride is important. Good Luck All.


  •  

    Posting Permissions

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