※デベロッパーツール等でソースコードをご確認ください(Please check using Developer tools)
.wrap {
position: relative;
width: 600px;
margin: 70px auto 0;
}
.progress {
position: absolute;
right: 0;
bottom: 0;
width: 100%;
height: 10px;
background: #eee;
}
.bar {
display: block;
width: 0%;
height: 10px;
background: #cecece;
}
@media screen and (max-width:640px){
.wrap {
width: 100%;
}
}
$(function(){
var run;
var progress = $('.bar');
var slick = $('.slider');
slick.slick({
pauseOnFocus: false,
pauseOnHover: false,
draggable: false,
fade: true
});
function start() {
reset();
percentTime = 0;
run = setInterval(interval, 10);
}
function interval() {
percentTime += 0.4;
progress.css({
width: percentTime+"%"
});
if(percentTime >= 100) {
slick.slick('slickNext');
start();
}
}
function reset() {
progress.css({
width: 0+'%'
});
clearTimeout(run);
}
start();
});