swiper3D.js是一款三维3d幻灯片轮播图插件

swiper3D.js是一款三维3d幻灯片轮播图插件

swiper3D.js是一款三维3d幻灯片轮播图插件

使用方式:

第一步引入bfwone 加载依赖项jquery

第二步use插件及css和主题css

第三步配置参数

var swiper_3D = new Swiper3D ({
       'slideContainer':'.swiper3D', // 必填 
       'slideWarpper':'.swiper-wrapper', // 必填
       'slide':'.swiper-slide', // 必填 
       'leftBtn':'.swiper3D-leftbtn', // 左按钮
       'rightBtn':'.swiper3D-rightbtn', // 右按钮
       'activeIndex':0, //初始化展示的第几个 slide
       'viewType': 5, // 3 展示 3张 ,5 展示 5张
       'durTime':200, // 切换过场时间,选填,默认400
       'autoPlay':true, //是否自动播放  false 不自动播放, true 自动播放 ,默认false
       'autoTime':3000 //自动播放事件 选填, 默认 4000,且只在自动播放开启时有效
    });

示例代码

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>BFW NEW PAGE</title>
    <script id="bfwone" data="dep=jquery.17&err=0" type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/bfwone.js"></script>
    <script type="text/javascript">
        bready(function() {
            use(["swiper3D", "swiper3D"], function() {
             var swiper_3D = new Swiper3D ({
			   'slideContainer':'.swiper3D',
			   'slideWarpper':'.swiper-wrapper',
               'slide':'.swiper-slide',
               'leftBtn':'.swiper3D-leftbtn',
               'rightBtn':'.swiper3D-rightbtn',
               'activeIndex':0,
               'viewType': 5,
               'durTime':200,
               'autoPlay':true,
               'autoTime':3000
            });
            new TouchTool({
                'obj': document.getElementById('swiper3D'),
                'direction': 'horizontal', //horizontal vertical水平垂直
                'slideLeft': function() {
                    swiper_3D.slideRight()
                },
                'slideRight': function() {
                    swiper_3D.slideLeft()
                }
            })
            });
        });
    </script>
     <style>
      </style>
</head>
<body>
    <div class="swiper-container swiper3D" id="swiper3D">
            <div class="swiper-wrapper">
                <div class="swiper-slide"> slide1 </div>
                <div class="swiper-slide"> slide2 </div>
                <div class="swiper-slide"> slide3 </div>
                <div class="swiper-slide"> slide4 </div>
                <div class="swiper-slide"> slide5 </div>
                <div class="swiper-slide"> slide6 </div>
                <div class="swiper-slide"> slide7 </div>
            </div>
            <div class="swiper3D-leftbtn"> < </div>
            <div class="swiper3D-rightbtn"> > </div>
        </div>
        <div class="navbox">
        	
        </div>
</body>
</html>	
立即下载swiper3D.js查看所有js插件

网友评论0

程序员在线工具箱