particles.js icon indicating copy to clipboard operation
particles.js copied to clipboard

Canvas size issue after resizing window

Open RM6SS62 opened this issue 4 years ago • 2 comments

I'm initializing it this way

particlesJS.load('particles-js', '/assets/js/particles.json', function() { let el = document.querySelector(".particles-js-canvas-el"); el.setAttribute("height", "500px"); });

If I un-maximize the window and then maximize it back I get this weird behavior, the canvas gets almost 3 times bigger

Before After

Particles.json

RM6SS62 avatar Jul 20 '20 13:07 RM6SS62

Why settings those attributes programmatically? Use CSS, particles.js adjust itself automatically.

Anyway this project is abandoned, I recommend you the litghter alternative tsParticles

matteobruni avatar Jul 20 '20 13:07 matteobruni

Oh, I think this project has not been abandoned, on the contrary it is very powerful and convenient. Please respect the author's work.

lindelof avatar Sep 02 '20 06:09 lindelof