Skip to content
项目

MahdiF/loud-links has 725 GitHub stars and 58 forks. GitHot measured 0 stars in 24 hours and -1 in 7 days. Last checked 2026-11-24 21:36 UTC. Last push 2024-08-24.

这些数字如何统计

实测星标增长

24小时
0
7天
-1
15天
正在收集历史
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

关于

:sound: 一个简单小巧的 JavaScript 库,可为网站添加交互音效。

网站与应用

README.md

原文

Loud Links

The library creates HTML5 audio element and uses it to play mp3/ogg audio files which is currently supported in all browsers.

Demo

Download


Usage

Step 1

Include the minified Javascript right before the </body> tag of your page.

...
<script src="js/loudlinks.min.js"></script>
</body>
</html>

Step 2

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

<div class=“loud-link-hover”> ... </div> <!-- sound on hover -->
<div class=“loud-link-click”> ... </div> <!-- sound on click -->

Step 3

Add the attribute data-sound” to the element with absolute URL of your sound file, substituting {{type}} for where mp3 or ogg would be (e.g. http://example.com/audio/noise.{{type}} ), or just the name of your sound file without the extension if your files are located at the root of your website under sounds/ folder with mp3/ and ogg/ subdirectories.

<div class=“loud-link-hover” data-sound="http://example.com/audio/noise.{{type}}"> ... </div> <!-- For absolute URLs, {{type}} will be replaced with '.mp3' and '.ogg' -->
<div class=“loud-link-hover” data-sound="noise"> ... </div> <!-- Look for /sounds/mp3/noise.mp3 and /sounds/ogg/noise.ogg at the root of your website directory. -->

License

See the LICENSE file for license rights and limitations (MIT).

探索相关项目

加载中…