Click here to Skip to main content
15,844,155 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
how to define an audio with no controls in jquery
and play it on mouse hover()?

any help appreciated!
Updated 14-Oct-13 8:25am

Is HTML5 a viable option for you? Then use the element <audio>:[^],[^],[^].

This element has the method play() which you can call in your handler of "hover":[^].

Share this answer
leave second function(mouseout) blank so audio plays only when entering mouse into "a" tag

    var audio = $('<audio>', {
      autoPlay : 'autoplay',
      controls : 'controls'
    addSource(audio, 'audio/ding.mp3');
    addSource(audio, 'audio/ding.wav');
    addSource(audio, 'audio/ding.ogg');

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900