MyBB Community Forums

Full Version: How can I add this Ripple Click Effect?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I add this:

To buttons on my theme. I've tried adding the js to headerinclude, the css to global.css then naming the divs etc but I don't think I'm doing it right.
(2018-03-12, 01:26 AM)Kioshi Wrote: [ -> ]¿Cómo puedo agregar esto ?:

A los botones de mi tema. He intentado agregar js a headerinclude, css a global.css y luego nombrar los divs, etc., pero no creo que lo esté haciendo bien.

en el js agrega 
var links = document.querySelectorAll('body');

for (var i = 0, len = links.length; i < len; i++) {
  links[i].addEventListener('click', function(e) {
    var targetEl =;
    var inkEl = targetEl.querySelector('.ink');

    if (inkEl) {
    else {
      inkEl = document.createElement('span');
      inkEl.classList.add('ink'); = = Math.max(targetEl.offsetWidth, targetEl.offsetHeight) + 'px';
    } = (e.offsetX - inkEl.offsetWidth / 2) + 'px'; = (e.offsetY - inkEl.offsetHeight / 2) + 'px';
  }, false);

revisa haber si te funciona....