Задать вопрос
@bazliiii

В чем ошибка подключение swiper slidera?

Почему swiper не работает ?
Код:

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

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.css" />
  <link rel="stylesheet" href="css/style.min.css">
</head>
<body>
<section class="slider-rewiews">
        <div class="container">
          <div class="slider-rewiews__inner">
            <h2 class="slider-rewiews__title"></h2>
            <div class="slider-rewiews__mask">
              <div class="slider-rewiews__swiper-container">
                <div class="swiper-container__swiper-wrapper">
                  <div class="slider-rewiews__swiper-slide">
                    <img src="images/slider-rewiews--1" alt="img" class="slider-rewiews__img">
                  </div>
                  <div class="slider-rewiews__swiper-slide">
                    <img src="images/slider-rewiews--2" alt="img" class="slider-rewiews__img">
                  </div>
                  <div class="slider-rewiews__swiper-slide">
                    <img src="images/slider-rewiews--3" alt="img" class="slider-rewiews__img">
                  </div>
                  <div class="slider-rewiews__swiper-slide">
                    <img src="images/slider-rewiews--4" alt="img" class="slider-rewiews__img">
                  </div>
                  <div class="slider-rewiews__swiper-slide">
                    <img src="images/slider-rewiews--5" alt="img" class="slider-rewiews__img">
                  </div>
                  <div class="slider-rewiews__swiper-slide">
                    <img src="images/slider-rewiews--6" alt="img" class="slider-rewiews__img">
                  </div>
                  <div class="slider-rewiews__swiper-slide">
                    <img src="images/slider-rewiews--7" alt="img" class="slider-rewiews__img">
                  </div>
                  <div class="slider-rewiews__swiper-slide">
                    <img src="images/slider-rewiews--8" alt="img" class="slider-rewiews__img">
                  </div>
                  <div class="slider-rewiews__swiper-slide">
                    <img src="images/slider-rewiews--9" alt="img" class="slider-rewiews__img">
                  </div>
                  <div class="slider-rewiews__swiper-slide">
                    <img src="images/slider-rewiews--10" alt="img" class="slider-rewiews__img">
                  </div>
                  <div class="slider-rewiews__swiper-slide">
                    <img src="images/slider-rewiews--11" alt="img" class="slider-rewiews__img">
                  </div>
                </div>
                <div class="slider-rewiews__swiper-pagination"></div>
              </div>
            </div>
          </div>
        </div>
      </section>
<script src="https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.js"></script>
  <script src="js/main.min.js"></script>
</body>

</html>


js:
$(function () {
    //slider

    const swiper = new Swiper(".slider-rewiews__swiper-container", {
      slidesPerView: 3,
      loop: true,
      centeredSlides: true,
      spaceBetween: 30,
      pagination: {
        el: ".slider-rewiews__swiper-pagination",
        clickable: true,
      }
    });
})
  • Вопрос задан
  • 65 просмотров
Подписаться 1 Простой Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы