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.

[Question] class instead of div for the container

See original GitHub issue

Which version are you using?

1.18.11

Is the latest version affected?

Not an issue.

Which library are you using?

  • Vanilla JS (tsparticles)
  • React (react-tsparticles)
  • Vue.js 2.x (particles.vue)
  • Vue.js 3.x (particles.vue3)
  • Angular (ng-particles)
  • Svelte (svelte-particles)
  • Preact (preact-particles)
  • Inferno (inferno-particles)
  • jQuery (jquery-particles)

Question

Instead of using tsparticles as a full size background I want to use it as an element that I can use to replace images. Right know the loader is supporter an id (which is an unique css selector) but is there a way to use a class (can match multiple elements) instead so I don’t have to create 10 identical classes and load tsparticles 10 times? But before that another question is can we load several times tsparticles on the same page?

image

Of course I’ll use the configuration for all the 10 elements.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
norajcommented, Jan 25, 2021

@matteobruni You’re amazing, thx a lot.

1reaction
matteobrunicommented, Jan 25, 2021

@noraj here you can find a sample with tsParticles in the hero you linked, a little CSS is needed but is not breaking the layout

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can we use <main> instead of <div class="container"> in ...
I am new to HTML. I like to know it is good to use mark semantic tag instead of something like div class="main-content"?...
Read more >
Does div class="container" have any special function?
Depends. if you are talking about bootstrap (you can click on the word bootstrap, will take you to interessting codecademy course) then yes,...
Read more >
Lesson 1: Understanding ID and Class in CSS
The first div is a container for the skip to main content link. The second div is a container for your contact information....
Read more >
<div>: The Content Division element - HTML - MDN Web Docs
The <div> HTML element is the generic container for flow content. It has no effect on the content or layout until styled in...
Read more >
Semantic HTML Guide – 10 Alternatives to Using divs
Use of more appropriate elements instead of the div element leads to better accessibility for readers and easier maintainability for authors.
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