Home >Web Front-end >HTML Tutorial >Basic use of swiper (3)
First implement a basic swiper page according to the content of the first lesson.
Then add attributes to the initialized js code.
Of course, don’t forget to quote the downloaded framework file in advance.
We first add the functional component of page turning navigation. It is convenient for us to confirm the vertical scrolling of the page and the style of navigation under vertical scrolling.
Add page navigation to the external container.
<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> <div class="swiper-pagination"></div> //翻页导航的div </div> <script> var swiper = new Swiper('.swiper-container',{ pagination:'.swiper-pagination', //绑定翻页导航 paginationClickable:true, //设定可以点击翻页导航进行翻页 direction:'vertical' //设定页面垂直翻页 }); </script>
This allows the page to scroll vertically.
The above is the basic use of swiper (3). For more related content, please pay attention to the PHP Chinese website (www.php.cn)!