luncheon / ripplet.js

Fully controllable vanilla-js material design ripple effect generator.
https://luncheon.github.io/ripplet.js/demo/
Do What The F*ck You Want To Public License
78 stars 7 forks source link

Disable right click for ripple effect? #8

Closed AgentSmith0 closed 1 year ago

AgentSmith0 commented 1 year ago

Hi, is there a way to disable the ripple effect for right click events, to only allow left click and touch input? Thank you!

luncheon commented 1 year ago

See the button property of the PointerEvent or MouseEvent.

myButton.addEventListener("pointerdown", event => {
  if (event.button === 0) { // left click or touch
    ripplet(event);
  }
});
AgentSmith0 commented 1 year ago

Thank you!