VincentGarreau / particles.js

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

Multiple particlesJS #33

Closed Spharian closed 9 years ago

Spharian commented 9 years ago

Hi, I'm trying to apply your plugin on multiple IDs, works fine for drawing it, but only the last created canvas is interactive/animated. Do you have any solution?

Thanks :)

ghost commented 9 years ago

I am also interested in that.

VincentGarreau commented 9 years ago

Hi @Spharian, @ignaty, Sorry for my late reply. Unfortunately I don't have enough time to keep the plugin, my apologies.

The plugin (v1.0.3) does not support multiple canvas element on the same page. For this, it would set the requestAnimFrame function + several interactions (mousemove, click, etc.) to each canvas. It is possible to create different canvas, but without animation and without interactivity. I'll study it ;)

joshfarrant commented 9 years ago

Would also love to see this

joshdickson commented 9 years ago

Would you accept a PR for this?

joshdickson commented 9 years ago

Or if you don't have time would you be open to a new maintainer? This is a great start and I'd love to be able to add to what you've got.

VincentGarreau commented 9 years ago

Supported in the 2.0.0 version https://github.com/VincentGarreau/particles.js/releases/tag/2.0.0 ;)

carlosnpz commented 6 years ago

How to implement this? Didn't find in the documentation...