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.
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({ |
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({ |
4. Change the play type to others.
1 |
$( '.button' ).easyAudioEffects({ |
This awesome jQuery plugin is developed by rm-labo. For more Advanced Usages, please check the demo page or visit the official website.