PHP Ferrari
PHP Ferrari

Reputation: 15664

Play sound on mouse hover using Javascript

Is it possible play song on mouse hover using javascript? If yes then how to code for it.

Upvotes: 2

Views: 673

Answers (3)

Nick Van Brunt
Nick Van Brunt

Reputation: 15484

If your audience is using screen readers it may be possible with aural style sheets:

http://www.w3.org/TR/CSS2/aural.html

blockquote.sad { play-during: url("violins.aiff") }

Upvotes: 1

Colin Sullivan
Colin Sullivan

Reputation: 153

I don't think you can do this with CSS. You can, however, use JavaScript to trigger an audio element to play when any other element is moused over.

Upvotes: 1

Web Logic
Web Logic

Reputation:

Nope, that's not possible. You need javascript for that.

Upvotes: 6

Related Questions