How to make rollover sound using CSS Jquery on a div when rolled in, stop when rolled out but make sound again immediately when rolled over again?

Hello Experts,

Gary was kind enough to help me get a start to add a rollover sound to a div when it is rolled over but the thing is I would like it so that when ever the mouse rollovers the div it will immediately make that  button rollover sound.
Gary gave me a clue using "loop" but the sound keep dinging over and over again if the mouse stayed over the div. Is there a way to make it just make the sound once and not again until another rollover?
Using "pause" made the rollover effect seem inoperable but "loop" was too much.

Thanks in advance.


Original Question and Answer
http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Jquery/Q_28495357.html#a40270471
colonelblueAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RobOwner (Aidellio)Commented:
The markup looks ok, you don't have the "loop" attribute set so it shouldn't loop.  Do you have a jsfiddle/jsbin for testing?
0
colonelblueAuthor Commented:
Hello no I don't have JSFiddle.
The loop was later graciously given to me add by Gary butter button keeps playing over and over again if mouse is on the div as opposed to just once which is the desired effect. But always responsive wen rolled over and not delayed.
0
RobOwner (Aidellio)Commented:
I would try a different event, so instead of

.hover,

use

.mouseenter(function() { ... play() ... })
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

GaryCommented:
If it's just a beep then remove the loop and for the jquery just use

$("#hoverme").hover(function () {
    $("#audio_test").trigger('play');
})

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
colonelblueAuthor Commented:
Thanks again.
So gar awesome. plays once on rollover.
But it plays again on rollout.  
Is there a way to not have a sound on rollout and only on rollover.

Thank you again!
0
GaryCommented:
It shouldn't.
Are you sure you are not firing another hover event, maybe your targetting is a bit off.
0
colonelblueAuthor Commented:
Gary = Awesome
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.