Home > Web Front-end > HTML Tutorial > Basic use of swiper (2)

Basic use of swiper (2)

黄舟
Release: 2017-01-20 15:10:39
Original
1203 people have browsed it

In the previous section, we implemented a basic sliding page, which has no function except sliding. So in this lesson, we will add other functional attributes to the page.

First implement a basic swiper page according to the content of the previous 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.


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(&#39;.swiper-container&#39;,{
pagination:&#39;.swiper-pagination&#39;,   //绑定翻页导航
paginationClickable:true        //设定可以点击翻页导航进行翻页
});
</script>
Copy after login


This adds a page navigation to the page.

The above is the basic use of swiper (2). For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template