Home > Web Front-end > HTML Tutorial > The use of swiper (1)

The use of swiper (1)

黄舟
Release: 2017-01-20 15:09:19
Original
2114 people have browsed it

swiper is a mobile page sliding framework. We can use this framework to write our own resume.

In addition to page sliding, swiper also provides a variety of other functional components for us to use.

And methods and callback functions.

We first implement a basic swiper page, a page with only page turning function.

First we need to reference the framework file. swiper.css and swiper.js

<link rel="stylesheet" href="swiper.css">
<script src="swiper.js"></script>
Copy after login

Create an external container. swiper-cotainer

<div class="swiper-container">
Copy after login

Then add an inner container to the outer container. swiper-wrapper

<div class="swiper-wrapper">
Copy after login

Add each flip page in the inner container

<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>
Copy after login




and then in Initialization in js

<script>
var swiper = new Swiper(&#39;.swiper-container&#39;);
</script>
Copy after login

The above is the content of using swiper (1). 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