Swiper Slide element transitioning Vertically as well on Page load #5461
-
The slide transitions vertically (sliding down) as well along with horizontal sliding. This occurs only when page is load. This happens on both Mobile & Desktop. Code<section id="home-banner-1" class="pt-28 md:pt-26">
<!-- Swiper -->
<!-- .homepage-banner-swiper {width: 100%;} -->
<div class="swiper swiper-container homepage-banner-swiper text-initial">
<div class="swiper-wrapper">
<div class="swiper-slide">
</div>
<div class="swiper-slide">
</div>
</div>
</div>
<script src="https://unpkg.com/swiper@7/swiper-bundle.min.js"></script>
<!-- Initialize Swiper -->
<script>
var swiper = new Swiper('.swiper-container', {
// Optional parameters
autoHeight: true,
autoplay: {
delay: 8000,
},
loop: true,
speed: 3000,
});
</script>
</section> Your comments & insights are appreciated. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You can set the wrapper to a |
Beta Was this translation helpful? Give feedback.
-
The min-height did not help me. However, Initializing the on swiper on
|
Beta Was this translation helpful? Give feedback.
The min-height did not help me. However, Initializing the on swiper on
DOMContentLoaded
orload
event fixed the issue for me. If swiper initialization is delayed, your image will be just a normal image, as soon as the swiper is initialized, the counter will start and your slides will changes as per your delay and speed parameters.Note: This may not work in advanced usages of Swiper where you may have multiple slides in view. This was tested on a full width single slide swiper