Advertisement
SMSabuj

OwlCarousel2

Apr 17th, 2020
1,067
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.87 KB | None | 0 0
  1. HTML
  2. -----
  3. <section class="slider-area">
  4.         <div class="slide-carousel owl-carousel">
  5.             <div class="single-slide-item slide-img-01"></div>
  6.             <div class="single-slide-item slide-img-02"></div>
  7.             <div class="single-slide-item slide-img-03"></div>
  8.             <div class="single-slide-item slide-img-04"></div>
  9.         </div>
  10. </section>
  11.  
  12. CSS
  13. ---
  14. .slide-img-01{background-image: url(../images/Business01.jpg);}
  15. .slide-img-02{background-image: url(../images/Business02.jpg);}
  16. .slide-img-03{background-image: url(../images/Business03.jpg);}
  17. .slide-img-04{background-image: url(../images/Business04.jpg);}
  18.  
  19.  
  20. .single-slide-item {
  21.     background-size: cover;
  22.     background-position: center;
  23.     height: 600px;
  24.     width: 100%;
  25. }
  26.  
  27. .slide-carousel.owl-carousel .owl-nav {
  28.     position: absolute;
  29.     top: 50%;
  30.     left: 70px;
  31.     color: #fff;
  32. }
  33.  
  34. .slide-carousel.owl-carousel .owl-nav button.owl-next {
  35.     position: absolute;
  36.     left: auto!important;
  37.     right: -1180px;
  38. }
  39.  
  40. .slide-carousel.owl-carousel .owl-nav i.fas {
  41.     font-size: 30px;
  42.     width: 60px;
  43.     height: 60px;
  44.     background: #333;
  45.     line-height: 56px;
  46.     text-align: center;
  47.     border-radius: 50%;
  48.     border: 3px solid #fff;
  49.     opacity: .2;
  50.     transition: .3s;
  51. }
  52.  
  53. .slide-carousel.owl-carousel .owl-nav:hover i.fas {
  54.     opacity: 1;
  55. }
  56.  
  57.  
  58. .slide-carousel .owl-dots {
  59.     position: absolute;
  60.     bottom: 20px;
  61.     width: 15px;
  62.     height: 15px;
  63.     background: #333;
  64.     left: 50%;
  65.     border-radius: 50%;
  66.     display: inline-block;
  67.     padding: 0px;
  68. }
  69.  
  70. JS
  71. -------
  72. $(document).ready(function(){
  73.           $(".owl-carousel").owlCarousel({
  74.             items: 1,
  75.             loop: true,
  76.             dots: true,
  77.             nav: true,
  78.             navText: ['<i class="fas fa-angle-left"></i>','<i class="fas fa-angle-right"></i>'],
  79.             autoplay: false,
  80.           });
  81.         });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement