Skip to content

srenault/mdl-ripple

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 effect manually:

const ripple = Ripple(item, {
  background: 'blue',
  duration: '2s',
  ignoreEvents: true
});

item.addEventListener('touchstart', ripple.trigger, false);

item.addEventListener('mousedown', ripple.trigger, false);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages