Guest User

Untitled

a guest
Jan 23rd, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. showRipple(e) {
  2. const rippleContainer = e.currentTarget;
  3. const size = rippleContainer.offsetWidth;
  4. const pos = rippleContainer.getBoundingClientRect();
  5. const x = e.pageX - pos.x - (size / 2);
  6. const y = e.pageY - pos.y - (size / 2);
  7. const style = 'top:' + y + 'px; left: ' + x + 'px; height: ' + size + 'px; width: ' + size + 'px;';
  8. const rippler = document.createElement('span');
  9. rippleContainer.appendChild(rippler);
  10. return rippler.setAttribute('style', style);
  11. }
Add Comment
Please, Sign In to add comment