🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

Ripple is a minimalist jQuery plugin used to apply Android L & Material Design concepted ripple effects to Html elements (e.g. UI buttons) when clicked or touched.

Material-Design ripple-effect

Documentation

jQuery-ripple

A jQuery Plugin for a ripple effect inspired by Google Material Design.

Installation

jQuery-ripple can be installed through Bower.

$ bower install jquery.ripple --save 

Usage

  1. Include the required jquery.ripple.css in the head section of your document.

    <link rel="stylesheet" href="bower_components/jquery-ripple/jquery.ripple.css"> 
  2. Include the latest version of jQuery and jQuery-ripple in your document.

    <script src="//code.jquery.com/jquery-latest.min.js"></script> <script src="bower_components/jquery-ripple/jquery.ripple.js"></script> 
  3. Create an element with the [data-ripple] data attribute defined.

    <button data-ripple>Button</button> 
  4. Call the plugin on the element.

    $('[data-ripple]').ripple(); 

Customization

Optionally, you can pass a different CSS color to use for the ripple ink:

$('[data-ripple]').ripple({ color: '#EF5734' }); 

Events

jQuery-ripple introduces three events that you can hook into for additional functionality:

Event Name Description
'beforeripple' Fired on touchstart/mousedown before ripple-active class is added to the DOM
'afterripple' Fired on touchend/mouseup/mouseleave before ripple-active class is removed from the DOM

You May Also Like