Skip to content

Instantly share code, notes, and snippets.

@Rad1calDreamer
Created April 1, 2015 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rad1calDreamer/075e6e942817fa520d0d to your computer and use it in GitHub Desktop.
Save Rad1calDreamer/075e6e942817fa520d0d to your computer and use it in GitHub Desktop.
ProgressBar for flickity
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