Home > Article > Web Front-end > Basic use of swiper (9)
In this lesson we introduce the multi-line display of swiper pages.
The first step is to create a basic page for swiper. But this time we are going to create more slides.
<div class="swiper-container"> <div class="swiper-wrapper"> <div class="swiper-slide">第一页</div> <div class="swiper-slide">第二页</div> <div class="swiper-slide">第三页</div> <div class="swiper-slide">第四页</div> <div class="swiper-slide">第五页</div> <div class="swiper-slide">第六页</div> <div class="swiper-slide">第七页</div> <div class="swiper-slide">第八页</div> <div class="swiper-slide">第九页</div> <div class="swiper-slide">第一页</div> <div class="swiper-slide">第二页</div> <div class="swiper-slide">第三页</div> <div class="swiper-slide">第四页</div> <div class="swiper-slide">第五页</div> <div class="swiper-slide">第六页</div> <div class="swiper-slide">第七页</div> <div class="swiper-slide">第八页</div> <div class="swiper-slide">第九页</div> <div class="swiper-slide">第一页</div> <div class="swiper-slide">第二页</div> <div class="swiper-slide">第三页</div> <div class="swiper-slide">第四页</div> <div class="swiper-slide">第五页</div> <div class="swiper-slide">第六页</div> <div class="swiper-slide">第七页</div> <div class="swiper-slide">第八页</div> <div class="swiper-slide">第九页</div> </div> <div class='swiper-pagination'></div> </div>
After that, we go to js to initialize our swiper
<script> var swiper = new Swiper('.swiper-container',{ pagination:'.swiper-pagination', paginationClickable:true, spaceBetween:10, slidesPerView:3, slidesPerColumn:3 //将swiper页面多行显示为:3行 }); </script>
It can be seen that we have not changed much this time. The implementation style is still to add an attribute during initialization---- -----slidePerColumn
Generally, this attribute is used in combination with group display. It is also best to add gaps between pages
The above is the content of the basic use of swiper (9). For more related content, please pay attention to the PHP Chinese website (www.php.cn)!