question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to avoid moving dom element

See original GitHub issue

Contact Details

No response

What do you need?

hey there currently when initiating tsparticles, it’s duplicating/moving the dom element and appending to document how I can prevent this behavior? I need the dom element to stay on its place

tsParticles Version

2.5.3

Which library are you using?

Vanilla (tsparticles)

Code of Conduct

  • I agree to follow this project’s Code of Conduct

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Mohsen-Khakbizcommented, Nov 21, 2022

silly me. that’s working as expected now. thanks for helping guys!

1reaction
munkacsimarkcommented, Nov 21, 2022

sorry my bad. I entered a wrong element id, and tsparticles automatically creating a dom element in the doc.

but now I have another question. how I can preserve the canvas size? let’s say I don’t want it to be fullscreen fullscreen.enable didn’t work here https://codepen.io/Mohsen-Khakbiz/pen/gOKoqVN

Hey, I checked your code. Don’t add <canvas> manually, the package will create it for you. Just define the div element like: <div id="particles-container"></div>. Related to your question, fullscreen should be fullScreen with camelCase.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prevent items from moving around in the DOM with CSS when ...
You can use absolute position : .first { position: absolute; top: 15px; left: 160px; } .second { position: absolute; left: 160px; } ...
Read more >
Moving Elements and Adding New Ones with DOM Manipulation
If you haven't watched the first video in my series on basic DOM manipulation, you'll want to catch up with that first.
Read more >
How do I move DOM elements with jQuery ? | Kevin Chisholm
The jQuery.appendTo method makes it easy to move a DOM element. You won't need to be concerned with creating or destroying elements and...
Read more >
Manipulating documents - Learn web development | MDN
Moving and removing elements. There may be times when you want to move nodes, or delete them from the DOM altogether. This is...
Read more >
Add elements to the DOM - Dart programming language
An Element object's parent is final and cannot be changed. So you cannot move an Element by changing its parent. Get an Element...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found