ページの読み込み後、スワイパーの高さは最初は正しいです。ウィンドウのサイズを小さくすると、スワイパーの高さが正しく再計算されます。ただし、ウィンドウのサイズを大きくすると、ほとんどの場合、スワイパーの高さが正しく計算されず、画像が部分的に非表示になります。ほとんどの場合、特定のウィンドウ サイズでは、高さが正しいことを意味します。
モバイル Chrome および Safari で、向きを変更すると、画像が部分的に非表示になります。コンテンツを上下にスワイプした後でのみ、スワイパーの高さが正しくなり、画像が完全に表示されます。
swiper-container とイメージの幅は、レスポンシブにするために 100% です。
手伝ってくれてありがとう。
----コード-----
<link rel="stylesheet" href="idangerous.swiper.css">
<style>
.swiper-container {
width: 100%;
text-align: center;
}
.pagination {
position: absolute;
left: 0;
text-align: center;
bottom:5px;
width: 100%;
}
.swiper-pagination-switch {
display: inline-block;
width: 10px;
height: 10px;
border-radius: 10px;
background: #999;
box-shadow: 0px 1px 2px #555 inset;
margin: 0 3px;
cursor: pointer;
}
.swiper-active-switch {
background: #fff;
}
</style>
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide"> <img src="images/slide1.png" width="100%" /> </div>
<div class="swiper-slide"> <img src="images/slide2.png" width="100%" /> </div>
<div class="swiper-slide">
<div class="content-slide">
<p class="title">Slide with HTML</p>
<p>You can put any HTML inside of slide with any layout, not only images, even another Swiper!</p>
</div>
</div>
</div>
<div class="pagination"></div>
</div>
<script src="idangerous.swiper.min.js"></script>
<script>
$(function() {
var mySwiper = new Swiper('.swiper-container',{
pagination: '.pagination',
loop:true,
grabCursor: true,
paginationClickable: true,
autoplay:3000,
roundLengths: true,
calculateHeight:true
});
});
</script>
<div>Some content goes here. .... </div>