troubleshooting Question

How to assign a different sound to different divs using the solution Gary gave me below?

Avatar of colonelblue
colonelblue asked on
CSSjQuery
7 Comments1 Solution504 ViewsLast Modified:
Hello Experts ( including Gary. ;) )

Using Gary's solution to add sound to a div on a rollover. How do I use this method applying different sound for different divs. In example. DIV Apple - sound is a crunch : DIV Banana - a slip sound..etc?

Is it as simple as changing the id name "hoverme" to something to else like a"apple" and creating another version of "audio_test" an d call it "apple_test"?

And secondly, how do I apply a sound to a like a regular "close button"?

<audio id="audio_test">
    <source src="http://demo.codesamplez.com/audio/pitbull.mp3" type="audio/mpeg">
        <source src="http://demo.codesamplez.com/audio/music.ogg" type="audio/ogg">
</audio>
<div id="hoverme">Hover me</div>

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


Thank you in advance.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros