Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

393
Visualizações
Swiper slider: slide change to other div

I have created a parallax slider but I have one big problem with changing the slider. I can change the slider when my mouse is inside the blue zone

enter image description here

As you could understand the blue zone (or the blue block) is the swiper-wrapper class, I can set the height to 100%, but in this case my layout is destroyed.

I want to know if swiper-slider provides me with such a property so that I can change the slider outside the blue zone (or outside the swiper-wrapper)?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If you want to create some space inside each slide add extra div inside swiper slide. **it is better to use % and not px for the space.

Snippet example:

const swiper = new Swiper('.swiper', {
  // Optional parameters
  loop: false,
  centeredSlidesBounds: true,
  slidesPerView: 2.1,
  spaceBetween: 20,
  // If we need pagination
  pagination: {
    el: '.swiper-pagination',
  },

  // Navigation arrows
  navigation: {
    nextEl: '.swiper-button-next',
    prevEl: '.swiper-button-prev',
  }
});
.swiper {
  width: 100%;
  height: 100%;
}

.card_inside_swiper{
  background: red;
  max-width: 90%;
  margin:  0px auto;
}
<link
      rel="stylesheet"
      href="https://unpkg.com/swiper@8/swiper-bundle.min.css"
      />

<style>
.swiper-slide {
  background: #2196f3;
  height: auto;
}
</style>

<!-- Slider main container -->
<div class="swiper">
  <!-- Additional required wrapper -->
  <div class="swiper-wrapper">
    <!-- Slides -->
    <div class="swiper-slide" data-city="london"><div class="card_inside_swiper"><p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).

</p></div></div>
    <div class="swiper-slide" data-city="london"><div class="card_inside_swiper"><p>hello</p></div></div>
    <div class="swiper-slide" data-city="london"><div class="card_inside_swiper"><p>hello</p></div></div>
    ...
  </div>
  <!-- If we need pagination -->
  <div class="swiper-pagination"></div>

  <!-- If we need navigation buttons -->
  <div class="swiper-button-prev"></div>
  <div class="swiper-button-next"></div>

</div>

<script src="https://unpkg.com/swiper@8/swiper-bundle.min.js"></script>

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda