My recent solution to this issue involved utilizing CSS keyframe animations.
The key to success is to have a wrapper div for your ticker with overflow hidden applied to it.
Make sure that the items within the ticker are set to display inline-block so they appear in a line:
<div class="ticker-wrap">
<div class="ticker">
<div class="ticker__item">Letterpress chambray brunch.</div>
<div class="ticker__item">Vice mlkshk crucifix beard chillwave meditation hoodie asymmetrical Helvetica.</div>
<div class="ticker__item">Ugh PBR&B kale chips Echo Park.</div>
</div>
</div>
Here is an example of the necessary CSS styling:
.ticker-wrap {
position: fixed;
bottom: 0;
width: 100%;
overflow: hidden;
height: 4rem;
background-color: rgba(51, 51, 51, 0.5);
padding-left: 100%; // offsets items to begin
}
.ticker {
display: inline-block;
height: 4rem;
line-height: 4rem;
white-space: nowrap;
padding-right: 100%; // taken from container as display inline-block
}
.ticker__item {
display: inline-block;
padding: 0 2rem;
font-size: 2rem;
color: white;
}
I also have a demo available that showcases how css keyframe animation can smoothly transition content infinitely from one side to the other. Please note that vendor prefixed versions are not shown.
@keyframes ticker {
0% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
100% {
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
}
}
To implement this effect, simply adjust the animation duration and apply it to .ticker.
.ticker {
animation-name: ticker;
animation-iteration-count: infinite;
animation-timing-function: linear;
animation-duration: 25s; // tweak based on number of items/desired speed
}
You can view the complete demonstration here