Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- showRipple(e) {
- const rippleContainer = e.currentTarget;
- const size = rippleContainer.offsetWidth;
- const pos = rippleContainer.getBoundingClientRect();
- const x = e.pageX - pos.x - (size / 2);
- const y = e.pageY - pos.y - (size / 2);
- const style = 'top:' + y + 'px; left: ' + x + 'px; height: ' + size + 'px; width: ' + size + 'px;';
- const rippler = document.createElement('span');
- rippleContainer.appendChild(rippler);
- return rippler.setAttribute('style', style);
- }
Add Comment
Please, Sign In to add comment