Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

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.