"Slider with popup modal (Vonjy)"
Bootstrap 4.1.1 Snippet by vonjyheritiana

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <link href="https://cdn.jsdelivr.net/jquery.slick/1.6.0/slick.css" rel="stylesheet" id="bootstrap-css"> <script src="//code.jquery.com/jquery-1.11.0.min.js"></script> <script src="//cdn.jsdelivr.net/jquery.slick/1.6.0/slick.min.js"></script> <div class="content"> <div class="slider"> <div> <div class="image" data-toggle="modal" data-target="#modal"> <img src="https://last-chance-dating.com/public/assets/photo_users/1562133750.png" alt="" style="width:170px; height:170px;"> </div> <!-- end image --> </div> <div> <div class="image" data-toggle="modal" data-target="#modal"> <img src="https://last-chance-dating.com/public/assets/photo_users/1561981980.png" alt="" style="width:170px; height:170px;"> </div> <!-- end image --> </div> <div> <div class="image" data-toggle="modal" data-target="#modal"> <img src="https://last-chance-dating.com/public/assets/photo_users/1562133660.png" alt="" style="width:170px; height:170px;"> </div> <!-- end image --> </div> <div> <div class="image" data-toggle="modal" data-target="#modal"> <img src="https://last-chance-dating.com/public/assets/photo_users/1562147617.png" alt="" style="width:170px; height:170px;"> </div> <!-- end image --> </div> <div> <div class="image" data-toggle="modal" data-target="#modal"> <img src="https://last-chance-dating.com/public/assets/photo_users/1562134555.png" alt="" style="width:170px; height:170px;"> </div> <!-- end image --> </div> </div> <!-- end slider --> <div class="progress" role="progressbar" aria-valuemin="0" aria-valuemax="100"> <span class="slider__label sr-only"> </div> </span> </div> <!-- end content --> <div class="modal fade affiche_modal" id="modal" tabindex="-1" role="dialog" aria-labelledby="Lightbox Gallery by Bootstrap 4" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-content"> <div class="modal-body"> <div id="lightbox" class="carousel slide" data-ride="carousel" data-interval="5000" data-keyboard="true"> <ol class="carousel-indicators"> <li data-target="#lightbox" data-slide-to="0"></li> <li data-target="#lightbox" data-slide-to="1"></li> <li data-target="#lightbox" data-slide-to="2"></li> <li data-target="#lightbox" data-slide-to="3"></li> <li data-target="#lightbox" data-slide-to="4"></li> </ol> <div id="affiche"> </div> <div class="carousel-inner "> <div class="carousel-item active"><img src="https://last-chance-dating.com/public/assets/photo_users/1562133750.png" class="w-100" alt=""></div> <div class="carousel-item"><img src="https://last-chance-dating.com/public/assets/photo_users/1561981980.png" class="w-100" alt=""></div> <div class="carousel-item"><img src="https://last-chance-dating.com/public/assets/photo_users/1562133660.png" class="w-100" alt=""></div> <div class="carousel-item"><img src="https://last-chance-dating.com/public/assets/photo_users/1562147617.png" class="w-100" alt=""></div> <div class="carousel-item"><img src="https://last-chance-dating.com/public/assets/photo_users/1562134555.png" class="w-100" alt=""></div> </div> <a class="carousel-control-prev" href="#lightbox" role="button" data-slide="prev"><span class="carousel-control-prev-icon" aria-hidden="true"></span><span class="sr-only">Previous</span></a> <a class="carousel-control-next" href="#lightbox" role="button" data-slide="next"><span class="carousel-control-next-icon" aria-hidden="true"></span><span class="sr-only">Next</span></a> </div> </div> </div> </div> </div> </div>
/** * Progress Bar */ .progress { display: block; width: 100%; height: 10px; border-radius: 10px; overflow: hidden; background-color: #f5f5f5; background-image: linear-gradient(to right, black, black); background-repeat: no-repeat; background-size: 0 100%; transition: background-size .4s ease-in-out; } /** * Demo Styles from the Slick Slider * website */ body { background-color: #3498db; } .content { margin: auto; padding: 20px; width: 600px; } .slider { margin: 30px auto 50px; } .image { padding: 10px; } img { border: 5px solid #FFF; display: block; width: 100%; } .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
$(document).ready(function() { var $slider = $('.slider'); var $progressBar = $('.progress'); var $progressBarLabel = $( '.slider__label' ); $slider.on('beforeChange', function(event, slick, currentSlide, nextSlide) { var calc = ( (nextSlide) / (slick.slideCount-1) ) * 100; $progressBar .css('background-size', calc + '% 100%') .attr('aria-valuenow', calc ); $progressBarLabel.text( calc + '% completed' ); }); $slider.slick({ slidesToShow: 3, slidesToScroll: 1, speed: 400 }); });

Related: See More


Questions / Comments: