Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

395
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda