VincentGarreau / particles.js

A lightweight JavaScript library for creating particles
https://vincentgarreau.com/particles.js/
MIT License
28.66k stars 4.81k forks source link

Interaction through the Text Layer #87

Open harshamv opened 8 years ago

harshamv commented 8 years ago

I am using the plugin for a full background where i have certain interactions. But when i trying to add a text layer on the top i am not able to have the interactions over the div containing the text.

Is there any way to get this to work with text over the canvas?

Demo Link

VincentGarreau commented 8 years ago

Hey @harshamv, try to set this:

particlesJS("particles-js", {
  "interactivity": {
    "detect_on": "window", // "canvas" or "window"
  }
});
harshamv commented 8 years ago

@VincentGarreau changed the z-index to achieve the best possible.

Will try this option as well and let you know :)

Darkness1337 commented 5 years ago

Same issue

alivtar commented 3 years ago

For me, changing interactivity.detect_on to 'window' didn't work. I changed the styles of canvas to:

canvas {
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  z-index: -10;
}

and styles of @dom-id to:

#that_dom_id {
 position: relative;
}
matteoums commented 3 years ago

This feature is available with tsParticles, you can read more here

michael-ono commented 1 year ago

Hey @harshamv, try to set this:

particlesJS("particles-js", {
  "interactivity": {
    "detect_on": "window", // "canvas" or "window"
  }
});

Where do i add this pls