JSFiddle - React, Tailwind, and code Playground
HTML
<div>
<span class="newsticker">
</span>
</div>
CSS
div {
border: 1px solid black;
}
span.newsticker {
border: 1px solid transparent;
}
.newsticker p {
margin: 50px;
vertical-align: middle;
}
JavaScript
$('.newsticker p').animate({
"marginLeft": "400px",
"opacity": ".0"
}, 600).fadeOut(100);
$('.newsticker').append("<p style='margin-left:400px;opacity:0'>Hello! This is a test<br/>more...</p>");
$('.newsticker p').animate({
"marginLeft": "0px",
"opacity": "1"
}, 600);