In this lesson we introduce the free mode of the swiper page.
The first step is to create a swiper basic page.
<div class="swiper-container"> <div class="swiper-wrapper"> <div class="swiper-slide">H5EDU 1<img src="logo.png"></div> <div class="swiper-slide">H5EDU 2<img src="logo.png"></div> <div class="swiper-slide">H5EDU 3<img src="logo.png"></div> <div class="swiper-slide">H5EDU 4<img src="logo.png"></div> <div class="swiper-slide">H5EDU 5<img src="logo.png"></div> <div class="swiper-slide">H5EDU 6<img src="logo.png"></div> <div class="swiper-slide">H5EDU 7<img src="logo.png"></div> <div class="swiper-slide">H5EDU 8<img src="logo.png"></div> <div class="swiper-slide">H5EDU 9<img src="logo.png"></div> <div class="swiper-slide">H5EDU 10<img src="logo.png"></div> </div> <div class="swiper-pagination"></div> </div>
Then we need to add the attributes of our free mode during initialization
<script> var swiper = new Swiper('.swiper-container',{ pagination:'.swiper-pagination', paginationClickable:true, slidesPerView:3, spaceBetween:30, freeMode:true //free模式开启 }); </script>
After implementation, let’s see the effect. In free mode, we can set the page turning position at Stop anywhere. No longer limited to the page
The above is the content of the basic use of swiper (8). For more related content, please pay attention to the PHP Chinese website (www.php.cn)!