javascript — добавить звуки на страницу

Loud links

Step 1

At the root of your website directory create a folder named “sounds” with 2 more folders inside it with the names “mp3” & “ogg”. sound folders

Step 2

Add the class “loud-link-hover” to any link/element that you want to give a sound on hover.

<div class=“loud-link-hover”></div>

Or add the class “loud-link-click” to any link/element that you want to give a sound on click.

<div class=“loud-link-click”></div>

Step 3

Add the attribute “src-data” to the element & write in it the name of your sound without the extension.

<div class=“loud-link-hover” src-data=“sound”></div>

Leave a Reply