Swiper正方体,左右翻转轮播图

摘要:
今天的旋转木马和往常有点不同!可以说有一点3D效果!因为当他移动时,他以立方体的形式左右滚动;简介插件:然后是同一句话:翠花,代码:˂!

今天的轮播图,和往常的有一点点不同哦!可以说是有一点点的3D效果!因为他在运动的时候,是以正方体的样子左右滚动的;

先引插件:

<link rel="stylesheet" href="http://t.zoukankan.com/swiper.css">
<script src="http://t.zoukankan.com/swiper.js"></script>

然后还是那句话:翠花,上代码:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Swiper demo</title>
	<meta name="viewport" content="width=device-width,initial-scale=1"/>

    <link rel="stylesheet" href="http://t.zoukankan.com/swiper.css">

    <style>
    /*样式*/
    html, body {
        position: relative;
        height: 100%;
    }
    body {
        background: #fff;
        font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
        font-size: 14px;
        color:#000;
        margin: 0;
        padding: 0;
    }
    img{
    	 100%;
    	height: 100%;
    }
    .swiper-container {
         500px;
        height: 500px;
        position: absolute;
        left: 45%;
        top: 35%;
        margin-left: -150px;
        margin-top: -150px;
    }
    .swiper-slide {
        background-position: center;
        background-size: cover;
    }
    </style>
</head>
<body>
<!-- Swiper轮播图 -->
    <div class="swiper-container">
        <div class="swiper-wrapper">
            <div class="swiper-slide"><img src="http://t.zoukankan.com/img/2d.jpg"/></div>
            <div class="swiper-slide"><img src="http://t.zoukankan.com/img/2d.jpg"/></div>
            <div class="swiper-slide"><img src="http://t.zoukankan.com/img/2d.jpg"/></div>
            <div class="swiper-slide"><img src="http://t.zoukankan.com/img/2d.jpg"/></div>
            <div class="swiper-slide"><img src="http://t.zoukankan.com/img/2d.jpg"/></div>
        </div>
        <div class="swiper-pagination"></div>
    </div>

    <script src="http://t.zoukankan.com/swiper.js"></script>

   <script>
    var swiper = new Swiper('.swiper-container', {
        pagination: '.swiper-pagination',
        
        //循环 往返的动
        loop:true,
                //小白点不能点击
		autoplayDisableOnInteraction:false,
		
        effect: 'cube',
        grabCursor: true,
        cube: {
            shadow: true,
            slideShadows: true,
            shadowOffset: 20,
            shadowScale: 0.94
        }
    });
    </script>
</body>
</html>

  有没有很简单啊!!!

免责声明:文章转载自《Swiper正方体,左右翻转轮播图》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Java-生成指定长度验证码的一种简单思路Mysql储存过程5: while下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

操作iframe 的方法与兼容性

首先创建两个页面 //iframe1.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> </head> <body...

margin的深入理解

第一部分:margin--基础知识 要介绍margin的基础知识,我们不可回避地要谈到css盒子模型(Box Model),一般而言,css盒子模型是用来设计和布局的。它本质上是一个盒子,包括:外边距(margin)、边框(border)、内边距(padding)以及最中间的内容(content)。下图即为盒子模型(这里只谈W3C规范的标准盒模型,而不谈I...

Bootstrap: 样式CSS:carousel轮换 图片的使用

Bootstrap 轮播(Carousel)插件   Bootstrap轮播(Carousel)插件是一种灵活的响应式的向站点添加滑块的方式。除此之外,内容也是足够灵活的,可以是图像、内嵌框架、视频或者其他您想要放置的任何类型的内容。 如果您想要单独引用该插件的功能,那么您需要引用 carousel.js。或者,您可以引用bootstrap.js 或压缩...

手机页面尺寸设置(一)

参考:http://webdesign.tutsplus.com/tutorials/htmlcss-tutorials/quick-tip-dont-forget-the-viewport-meta-tag/ 一、网页手机wap2.0网页的head里加入下面这条元标签,在iPhone的浏览器中页面将以原始大小显示,并不允许缩放。 其中: width -...

swiper基本使用

参数名 类型 是否必填 描述 swiperContainer HTMLElement or string 必选 Swiper容器的css选择器,例如".swiper-container" parameters object 可选 Swiper的个性化配置 一个页面中引用多个Swiper,可以给每个容器加上ID或Class区分,要保留默...

iOS 简易无限滚动的图片轮播器-SDCycleScrollView

@interfaceViewController() <</span>SDCycleScrollViewDelegate> @end @implementationViewController - (void)viewDidLoad { [superviewDidLoad]; self.view.backgroundColor= [...