Infinite background-image animation loop

7 thoughts on “Infinite background-image animation loop”

  1. That’s very cool. Would something like this work with just css
    .big-spam-sorter--comments-left,
    .big-spam-sorter--comments-right {
    -webkit-animation: slide 2s linear infinite;
    -moz-animation: slide 2s linear infinite;
    animation: slide 2s linear infinite;
    }
    @-webkit-keyframes slide
    {
    0% {background-position: 0 0;}
    100% {background-position: 100px 0;}
    }

    @-moz-keyframes slide
    {
    0% {background-position: 0 0;}
    100% {background-position: 100px 0;}
    }

    @keyframes slide
    {
    0% {background-position: 0 0;}
    100% {background-position: 100px 0;}
    }

    Like

    1. I explored @keyframes briefly, but the problem that I came across is that I can’t incrementally increase the background position to continue the movement.

      In your example the comment bubbles would move 100px to the right, then move back to their starting position at 0. Instead of continuing to move to the right as if on a conveyor belt, they would just move back and forth.

      This is why I used jQuery to move the background position since I can use '+=102' to move the background by 102px regardless of current position.

      Like

Leave a comment