From f813f977c471cb4ce7ecfdb742b157407ccc3c47 Mon Sep 17 00:00:00 2001 From: Rok Sprogar Date: Wed, 28 Oct 2020 18:55:55 +0100 Subject: [PATCH] disable pointer events if clicks are disabled --- particles.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/particles.js b/particles.js index 325d8349..fdd92451 100644 --- a/particles.js +++ b/particles.js @@ -1494,6 +1494,11 @@ window.particlesJS = function(tag_id, params){ pJS_canvas_class = 'particles-js-canvas-el', exist_canvas = pJS_tag.getElementsByClassName(pJS_canvas_class); + /* disable pointer events on canvas if clicks are disabled */ + if (!params.interactivity.events.onclick.enable) { + pJS_tag.style.pointerEvents = 'none'; + } + /* remove canvas if exists into the pJS target tag */ if(exist_canvas.length){ while(exist_canvas.length > 0){