Trying to make confetti effect after clicking an image
07:34 26 Apr 2026

I'm trying to use tsparticles to make some confetti go off after clicking an image, but I can't seem to work out how.

Here's my code:

(async engine => {   
    await loadConfettiFallingPreset(engine);
    await engine.load({     
      options: {       
      preset: "confettiFalling", // or "confetti-falling"     
      },   
    }); 
})(tsParticles);

polaroid-top.addEventListener("click", () => {     
    confettiFalling(("tsparticles")) 
})

(polaroid-top is the id of my image)

javascript tsparticles