Skip to content

Commit

Permalink
currentSlide以外のプログレスバーは非アクティブな色になるように修正
Browse files Browse the repository at this point in the history
  • Loading branch information
jun68ykt committed Jul 26, 2019
1 parent 0e7c897 commit 1687777
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 8 additions & 0 deletions extra.css
Expand Up @@ -17,6 +17,14 @@
width: 25%;
}

.progress-bar-box:nth-child(even) {
background-color: #888;
}

.progress-bar-box:nth-child(odd) {
background-color: #aaa;
}

.bar {
height: 100%;
width: 0px;
Expand Down
4 changes: 1 addition & 3 deletions main.js
Expand Up @@ -19,9 +19,7 @@ $(document).ready(function() {
nextArrow: '<img src="https://dummyimage.com/100x100/fff/000&text=Next" class="slide-arrow slick-next">',
adaptiveHeight: true
}).on('afterChange', function(event, slick, currentSlide) {
if (currentSlide === 0)
$('.bar').css({width: 0});
$('.bar').startBar(currentSlide);
$('.bar').css({width: 0}).startBar(currentSlide);
});

$('.bar').startBar(0);
Expand Down

0 comments on commit 1687777

Please sign in to comment.