jQuery Plugin For Adding Sound Effects To Elements easyaudioeffects js - Download jQuery Plugin For Adding Sound Effects To Elements - easyaudioeffects.js

Download jQuery Plugin For Adding Sound Effects To Elements – easyaudioeffects.js

Posted on

This time I will share jQuery Plugin and tutorial about jQuery Plugin For Adding Sound Effects To Elements – easyaudioeffects.js, hope it will help you in programming stack.

jQuery Plugin For Adding Sound Effects To Elements easyaudioeffects js - Download jQuery Plugin For Adding Sound Effects To Elements - easyaudioeffects.js
File Size: 736 KB
Views Total: 2593
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   



easyaudioeffects.js is a jQuery plugin for adding sound effects (ogg and mp3) to any html elements that supports custom trigger events and play types.

How to use it:

1. Put jQuery library and the jQuery easyaudioeffects.js script at the bottom of your webpage.

1 <script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
2 <script src="jquery.easyaudioeffects.1.0.0.js"></script>

2. Call the plugin on the target element and specify the paths to the audio files.

1 $('.button').easyAudioEffects({
2   ogg : "sound.ogg",
3   mp3 : "sound.mp3"
4 });

3. By default, the plugin will play the sound effect on hover. You can config the plugin to play the sound effect on click by passing the ‘eventType’ option during initialization.

1 $('.button').easyAudioEffects({
2   ogg : "sound.ogg",
3   mp3 : "sound.mp3",
4   eventType : 'click',
5 });

4. Change the play type to others.

1 $('.button').easyAudioEffects({
2   ogg : "sound.ogg",
3   mp3 : "sound.mp3",
4   eventType : 'click', // [ hover / click ]
5   playType : "gate", // [ oneShotPolyphonic / oneShotMonophonic / gate / loop ]
6 });

This awesome jQuery plugin is developed by rm-labo. For more Advanced Usages, please check the demo page or visit the official website.




source : jqueryscript.net