Last active
December 28, 2015 00:49
-
-
Save akre54/7416538 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var runner = document.querySelector('.ticker'), // a <ul> | |
frames = runner.children, | |
timeout = 4000; // in ms | |
var cycleFrames = function() { | |
var child = runner.removeChild(frames[0]).cloneNode(true); | |
runner.appendChild(child); | |
} | |
// from https://gist.github.com/joelambert/1002116 | |
requestInterval(cycleFrames, timeout); |
This file contains hidden or 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
.slider-fx-fade > * | |
position: absolute | |
opacity: 0 | |
visibility: hidden | |
transition: opacity 1s ease | |
&:first-child | |
opacity: 1 | |
visibility: visible | |
.slider-fx-scroll-down > * | |
position: absolute | |
transition: transform 4s linear | |
$item-height = 250 | |
for i in(1...40) | |
$offset = i * $item-height - $item-height | |
&:nth-child({i}) | |
transform: translate3d(0px, $offset px, 0) | |
.slider-fx-scroll-left > * | |
position: absolute; | |
top: 0; | |
left: 0; | |
display: inline-block | |
transition: transform 4s linear | |
item-width = 250 | |
for i in(1...40) | |
$offset = i * $item-width - 2 * $item-width | |
&:nth-child({i}) | |
transform: translate3d($offset px, 0px, 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment