Comments (7)
Hey @XRyu ,
You can do it by this way:
pJSDom[0].pJS.particles.move.enable = false;
To restart:
pJSDom[0].pJS.particles.move.enable = true;
pJSDom[0].pJS.fn.particlesRefresh();
from particles.js.
Is it possible to pause the movement, and then re-enable it without refreshing?
I want to pause an animation while the user is scrolling.
from particles.js.
Is it possible to pause the movement, and then re-enable it without refreshing?
I want to pause an animation while the user is scrolling.
pause() {
this._tempFn = this.pJS.fn.vendors.draw
window.pJSDom[0].pJS.fn.vendors.draw = () => {
}
}
play() {
window.pJSDom[0].pJS.fn.vendors.draw = this._tempFn
window.pJSDom[0].pJS.fn.vendors.draw()
}
from particles.js.
If you want to destroy it, see #63 (comment)
from particles.js.
Is there a similar method for turning interactivity on and off?
pJSDom[0].pJS.interactivity.events.onclick["enable"] = false;
from particles.js.
@VincentGarreau, thanks so much!
from particles.js.
Is it possible to pause the movement, and then re-enable it without refreshing?
I want to pause an animation while the user is scrolling.pause() { this._tempFn = this.pJS.fn.vendors.draw window.pJSDom[0].pJS.fn.vendors.draw = () => { } } play() { window.pJSDom[0].pJS.fn.vendors.draw = this._tempFn window.pJSDom[0].pJS.fn.vendors.draw() }
It worked for me with corrected second line:
pause() {
this._tempFn = window.pJSDom[0].pJS.fn.vendors.draw;
window.pJSDom[0].pJS.fn.vendors.draw = () => {};
}
play() {
window.pJSDom[0].pJS.fn.vendors.draw = this._tempFn;
window.pJSDom[0].pJS.fn.vendors.draw();
}
from particles.js.
Related Issues (20)
- decrease the movement speed
- Can't interact with the page content - Elementor HOT 1
- Particle.js overlaps everything HOT 1
- Push particles based on variable change in a seperate function HOT 3
- Render single frame for prefers-reduced-motion HOT 1
- How to disable interactivity HOT 1
- s
- Problem with particles.js 2023 HOT 1
- Particles dont interact while hovering or clicking HOT 1
- Uncaught ReferenceError: Stats is not defined in Wordpress HOT 1
- idk
- how to use config file HOT 1
- particals js error
- Documentation HOT 2
- Make code compatible with ES5 strict mode HOT 2
- How can I reset the particles to initial position?
- Particles as a background
- New particles duration?
- Hold down instead of on click on push animation?
- Rotate is not working?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from particles.js.