My goal is to always show text on my tag marquee without spaces. A text should always appear showing in this usual animation.
My goal is to always display text on my tag marquee without spaces. A text should always appear showing in this usual animation. In my real project, I am constantly receiving tweets and I am putting them in the marquee, I delete the first one and then I make a .append as long as the amount is 5 (not a good solution, if 10 tweets arrive in a second, the User can not read the marquee well. I would like to have 5 span inside the marquee, at a certain point my web page starts to become slow by constantly performing a .append and having many span elements).
With the set interval I'm simulating as if receiving the tweets, but at one point the animation is not fluid, or restarts showing spaces. The only space I want to show is the initial, otherwise I do not want to show spaces.
I do not know how to solve this, or if there is an event or something I can do to detect when the first span leaves the container, in order to add a new element and can read the marquee well.
I have tried several libraries, but none suits my problem.
<div id='container_marquee'>
<marquee id='mymarquee' behavior="scroll" onmouseover="this.stop();" onmouseout="this.start();">
<span>first marquee text</span>
<span>second marquee text</span>
<span>third marquee text</span>
<span>fourth marquee text</span>
<span>fifth marquee text</span>
</marquee>
</div>