MahdiF/loud-links
소개
:sound: 웹사이트에 상호작용 사운드를 추가하는 간단하고 작은 JavaScript 라이브러리입니다.
웹 및 앱측정된 스타 증가
- in 24h
- 0
- in 7 days
- -1
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalLoud 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).
관련 프로젝트 살펴보기
불러오는 중…