mdl-ripple
v0.0.5
Published
Material design ripple effect
Downloads
12
Readme
mdl-ripple
Adapt material design lite code to be able to add ripple effect on any dom element.
Install
npm install --save mdl-ripple
API
import Ripple from './ripple.js';
const item = document.querySelector('li');
const rippleItem = Ripple(item, {
background: 'red',
duration: '2s'
});
// Unbind events
rippleItem.downgrade();
Or by triggering ripple effet manually:
const ripple = Ripple(item, {
background: 'blue',
duration: '2s',
ignoreEvents: true
});
item.addEventListener('touchstart', ripple.trigger, false);
item.addEventListener('mousedown', ripple.trigger, false);