CSS-Tricks Example

Play Audio on :hover

We're going to use the Web Audio API here, no Flash, no HTML5 audio elements.

We're using jQuery in this demo to make selecting things and events easier, but it is not required. We are also using a small framework to make working with the Web Audio API easier.

This script shown below simply loads a sound file, and then when you mouse over a the navigation links, it plays the sound at the precise time of the event.