翠花,上代码:
Swiper demo
html, body {
position: relative;
height: 100%;
}
body {
background: #eee;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 14px;
color:#000;
margin: 0;
padding: 0;
}
.swiper-container {
width: 100%;
height: 100%;
}
.swiper-slide {
text-align: center;
font-size: 18px;
background: #fff;
/* Center slide text vertically */
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
}
var swiper = new Swiper('.swiper-container', {//小白点
pagination: '.swiper-pagination',
paginationClickable: true
});
最后 别忘了再打这些东西之前要引Swiper.css和Swiper.js插件哦!
以上是Swiper轮播图源码分享解析的详细内容。更多信息请关注PHP中文网其他相关文章!