Owl Carousel 2 Thumbnails plugin (ok)

https://github.com/gijsroge/OwlCarousel2-Thumbs

Ví dụ 1: https://codepen.io/aykutkapisiz/pen/POGJxg

C:\xampp81\htdocs\today\test.html

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
  <script src="//code.jquery.com/jquery.js"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css" />
  <link rel="stylesheet" type="text/css" href="style.css">
  <script type="text/javascript" src="script.js"></script>
  <title>Document</title>
</head>

<body>
  <div id="sync1" class="owl-carousel owl-theme">
    <div class="item">
      <h1>1</h1>
    </div>
    <div class="item">
      <h1>2</h1>
    </div>
    <div class="item">
      <h1>3</h1>
    </div>
    <div class="item">
      <h1>4</h1>
    </div>
    <div class="item">
      <h1>5</h1>
    </div>
    <div class="item">
      <h1>6</h1>
    </div>
    <div class="item">
      <h1>7</h1>
    </div>
    <div class="item">
      <h1>8</h1>
    </div>
  </div>
  <div id="sync2" class="owl-carousel owl-theme">
    <div class="item">
      <h1>1</h1>
    </div>
    <div class="item">
      <h1>2</h1>
    </div>
    <div class="item">
      <h1>3</h1>
    </div>
    <div class="item">
      <h1>4</h1>
    </div>
    <div class="item">
      <h1>5</h1>
    </div>
    <div class="item">
      <h1>6</h1>
    </div>
    <div class="item">
      <h1>7</h1>
    </div>
    <div class="item">
      <h1>8</h1>
    </div>
  </div>
</body>

</html>

C:\xampp81\htdocs\today\style.scss

#sync1 {
  .item {
    background: #0c83e7;
    padding: 80px 0px;
    margin: 5px;
    color: #FFF;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    text-align: center;
  }
}
#sync2 {
  .item {
    background: #C9C9C9;
    padding: 10px 0px;
    margin: 5px;
    color: #FFF;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    text-align: center;
    cursor: pointer;
    h1 {
      font-size: 18px;
    }
  }
  .current .item{
    background: #0c83e7;
  }
}
.owl-theme {
  .owl-nav {
    [class*='owl-'] {
      transition: all .3s ease;
      &.disabled:hover {
       background-color: #D6D6D6;
      }   
    }
  }
}
#sync1.owl-theme {
  position: relative;
  .owl-next, .owl-prev {
    width: 22px;
    height: 40px;
    margin-top: -20px;
    position: absolute;
    top: 50%;
  }
  .owl-prev {
    left: 10px;
  }
  .owl-next {
    right: 10px;
  }
}

Ví dụ 2:

<!doctype html>
<meta charset=utf-8>
<meta name=description content="Enables thumbnail support for Owl Carousel 2.0">
<link rel=stylesheet href="http://localhost/library/owlcarousel2/normalize.css">
<link rel=stylesheet href="http://localhost/library/owlcarousel2/owl.carousel.min.css">
<link rel=stylesheet href="http://localhost/library/owlcarousel2/owl.theme.default.min.css">
<title>owl Carousel 2 Thumbnail Demo</title>
<style>
* {
  -webkit-box-sizing: border-box;
  /* Safari 3.0 - 5.0, Chrome 1 - 9, Android 2.1 - 3.x */
  -moz-box-sizing: border-box;
  /* Firefox 1 - 28 */
  box-sizing: border-box;
}

body,
html {
  height: 100%;
}

img {
  vertical-align: middle;
}

.owl-carousel {
  height: 100%;
}

.owl-carousel .owl-item,
.owl-carousel .item {
  height: 100vh;
}

.owl-carousel .owl-item img {
  transform-style: initial;
  height: 100%;
  object-fit: cover;
}

.owl-thumb-item img {
  width: 150px;
  height: auto;
}

.owl-thumbs {
  position: absolute;
  bottom: 0;
  left: 0;
  display: table;
  width: 100%;
  text-align: center;
  padding: 5%;
}

.owl-thumb-item {
  display: table-cell;
  border: none;
  background: none;
  padding: 0;
  opacity: .4;
}

.owl-thumb-item.active {
  opacity: 1;
}

.label {
  position: absolute;
  top: 20px;
  right: 20px;
  background-color: #0a6cff;
  color: white;
  padding: 10px 20px;
  z-index: 5;
  text-align: center;
}
</style>
<a onClick="_gaq.push(['_trackEvent', 'download', 'download',,, true]);" href="https://github.com/gijsroge/OwlCarousel2-Thumbs" class="label">download on GitHub</a>
<div class="owl-carousel">
  <div class="item">
    <img src="https://unsplash.imgix.net/photo-1426200830301-372615e4ac54?fit=crop&fm=jpg&h=1080&q=75&w=1900" alt="photo by Barn Images">
  </div>
  <div class="item">
    <img src="https://ununsplash.imgix.net/photo-1423753623104-718aaace6772?fit=crop&fm=jpg&h=1080&q=75&w=1900" alt="photo by Joshua Earle">
  </div>
  <div class="item">
    <img src="https://ununsplash.imgix.net/photo-1421098518790-5a14be02b243?fit=crop&fm=jpg&h=1080&q=75&w=1900" alt="photo by Alexander Dimitrov">
  </div>
  <div class="item">
    <img src="https://unsplash.imgix.net/photo-1423439793616-f2aa4356b37e?fit=crop&fm=jpg&h=1080&q=75&w=1900" alt="photo by Wojciech Szaturski">
  </div>
  <div class="item">
    <img src="https://ununsplash.imgix.net/uploads/14127101912749510b8ed/82743738?fit=crop&fm=jpg&h=1080&q=75&w=1900" alt="photo by Kyle Szegedi">
  </div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="http://localhost/library/owlcarousel2/owl.carousel.min.js"></script> 
<script src="http://localhost/library/owlcarousel2thumbs/owl.carousel2.thumbs.min.js"> </script> <script>
var owl = $('.owl-carousel');
owl.owlCarousel({
  loop: true,
  items: 1,
  thumbs: true,
  thumbImage: true,
  thumbContainerClass: 'owl-thumbs',
  thumbItemClass: 'owl-thumb-item'
});
</script>

Last updated