ezekielaquino / Marquee3000

Marquees for the new millenium
https://ezekielaquino.com/2019/marquee
MIT License
438 stars 81 forks source link

How to actually use it on multiple elements? #13

Open arso1er opened 6 years ago

arso1er commented 6 years ago

Hi, I have a ul with a bunch of lis, and I'd like the lis to scroll. But when I apply the marquee3k class to my ul, only the first li scrolls. When I apply marquee3k to each li, they scroll independently.

How can I scroll all my lis on the same line?

Komsomol commented 6 years ago

I ran into the same issue. The library only takes the first HTML element to apply the effect on. From the code - this.content = element.children[0];

Thus it's best to push everything into that first element (div / ul) and then use CSS to have them all appear to be on the same line.

For example, I have a div called 'content', into that I pushed my dynamic content as

then set those elements to be display: inline-block;