-
-
Save danhauk/3744611109326451fa30 to your computer and use it in GitHub Desktop.
Conveyor belt animation using CSS transition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.big-spam-sorter--comments-left, | |
.big-spam-sorter--comments-right { | |
height: 72px; | |
position: absolute; | |
bottom: 150px; | |
width: 1000px; | |
-webkit-transition: background-position 8000ms linear; | |
-moz-transition: background-position 8000ms linear; | |
-o-transition: background-position 8000ms linear; | |
transition: background-position 8000ms linear; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function conveyorLoop() { | |
$('.big-spam-sorter--comments-left, .big-spam-sorter--comments-right').css({ | |
'background-position': '+=102' | |
}); | |
// call function again after same | |
// interval as the CSS transition | |
setTimeout( conveyorLoop, 8000 ); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
kkkk