Created
April 1, 2015 10:59
-
-
Save Rad1calDreamer/075e6e942817fa520d0d to your computer and use it in GitHub Desktop.
ProgressBar for flickity
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
add div.progressbar into slider's container | |
add option 'cellSelector' | |
and add some callbacks : | |
$gallery.on( 'cellSelect', function() { | |
var el = $('.progressbar'); | |
var newone = el.clone(true); | |
el.before(newone); | |
$("." + el.attr("class") + ":last").remove(); | |
}) | |
style for progressBar: | |
.progressbar{ | |
height: 7px; | |
background-color: #fff; | |
border: 1px solid #7b1b1b; | |
-webkit-box-sizing: border-box; | |
-moz-box-sizing: border-box; | |
box-sizing: border-box; | |
position: absolute; | |
bottom: 0; | |
left: 0; | |
width: 100%; | |
z-index: 2; | |
&::before{ | |
content: ''; | |
display: block; | |
height: 100%; | |
animation: progressBar 4s; | |
background-color: #7b1b1b; | |
} | |
} | |
@keyframes progressBar { | |
0% {width: 0%;} | |
100%{width: 100%;} | |
} | |
option ' autoPlay' must be equal to animation duration parameter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment