This time I will share jQuery Plugin and tutorial about jQuery Plugin For Water Ripple Animation – ripples, hope it will help you in programming stack.
ripples is a fancy jQuery plugin that creates a water ripple animation following the mouse cursor on an Html element based on WebGL. Currently works with modern browsers that support at least one of the following: WebGL, OES_texture_float extension, OES_texture_float_linear extension.
How to use it:
1. Include the jQuery javascript library and jQuery ripples plugin at the end of the html document.
2 |
< script src = "js/jquery.ripples.js" ></ script > |
2. Create an Html element with a background image that you want to apply the effect to.
1 |
< div class = "demo" style = "background-image:url(1.jpg)" > |
3. Call the plugin with options.
4. API methods.
02 |
$('.demo').ripples('show'); |
05 |
$('.demo').ripples('hide'); |
08 |
$('.demo').ripples('destroy'); |
10 |
// play the simulation's state |
11 |
$('.demo').ripples('play'); |
13 |
// pause the simulation's state |
14 |
$('.demo').ripples('pause'); |
16 |
// add a drop at the element's relative coordinates (x, y). |
17 |
// radius controls the drop's size and strength the amplitude of the resulting ripple. |
18 |
$('.demo').ripples('drop', x, y, radius, strength); |
Changelog:
2019-09-16
- v0.6.3: Actually get rid of all references when destroying an instance
2018-02-21
- v0.6.2: Fix effect not working on iOS
2017-09-06
- v0.6.1: Get rid of WebGL warning
2017-07-15
2016-09-12
2016-06-20
2015-09-04
2015-07-26
- Make OES_texture_float_linear optional
2015-04-11
- Add “interactive” property
2015-03-17
- Use isPercentage function instead of endsWith
2015-02-25
2014-11-04
- Added method to create drops programmatically
2014-10-31
2014-07-19
This awesome jQuery plugin is developed by sirxemic. For more Advanced Usages, please check the demo page or visit the official website.