swiper-上下滚动翻页

  <html>
        <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>元宵节</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link rel="stylesheet" href="css/swiper.min.css">
    <script src="css/swiper.min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        html,
        body {
            height: 100%;
        }
        
        body {
            font-family: "microsoft yahei";
        }
        
        .swiper-container {
            width: 100%;
            height: 100%;
            background: #fff;
        }
        
        .swiper-slide {}
        
        .swiper-slide {
            width: 100%;
            height: 100%;
            background: url(upload/9.jpg) no-repeat left top;
            /*每一页的背景图*/
            background-size: 100% 100%;
        }
        
        /*img {
            display: block;
        }*/
        
        /*.swiper-pagination-bullet {
            width: 6px;
            height: 6px;
            background: #fff;
            opacity: .4;
        } 小点样式*/
        
        /*.swiper-pagination-bullet-active {
            opacity: 1;
        }小点样式*/
        
        @-webkit-keyframes tipmove {
            0% {
                bottom: 10px;
                opacity: 0
            }
            50% {
                bottom: 15px;
                opacity: 1
            }
            100% {
                bottom: 20px;
                opacity: 0
            }
        }
        
        .ani {
            position: absolute;
        }
        
        .txt {
            position: absolute;
        }
        
        #array {
            position: absolute;
            z-index: 999;
            -webkit-animation: tipmove 1.5s infinite ease-in-out;
        }
    </style>
</head>

<body>
    <div class="swiper-container swiper-container-vertical">
        <div class="swiper-wrapper" style="transition-duration: 0ms; transform: translate3d(0px, 0px, 0px);">
            <!-------------slide1----------------->
            <section class="swiper-slide swiper-slide-active" style="height: 480px;">

            </section>
            <!---------------slide2-------------->
            <section class="swiper-slide swiper-slide-next" style="height: 480px;">
                
            </section>
            <!----------------slide3-------------->
            <section class="swiper-slide" style="height: 480px;">

            </section>
            <!-------------slide4----------------->
            <section class="swiper-slide" style="height: 480px;">

            </section>
        </div>
         <!--底部的三角-->
        <img src="upload/web-swipe-tip.png" style="width:20px;height:15px; top:460px; left:150px;" id="array" class="resize">

    </div>

    <script>
        scaleW = window.innerWidth / 320;
        scaleH = window.innerHeight / 480;
        var resizes = document.querySelectorAll('.resize');
        for(var j = 0; j < resizes.length; j++) {
            resizes[j].style.width = parseInt(resizes[j].style.width) * scaleW + 'px';
            resizes[j].style.height = parseInt(resizes[j].style.height) * scaleH + 'px';
            resizes[j].style.top = parseInt(resizes[j].style.top) * scaleH + 'px';
            resizes[j].style.left = parseInt(resizes[j].style.left) * scaleW + 'px';
        }
        //底部三角的位置
        
        
        
        
    

        var mySwiper = new Swiper('.swiper-container', {
            direction: 'vertical',
        
            mousewheel: true,//是否支持滚轮
            on: {
                init: function() {
                    swiperAnimateCache(this);
                    swiperAnimate(this);
                },
                slideChangeTransitionEnd: function() {
                    swiperAnimate(this);
                }
            }
        })
    </script>
</body>
</html>
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容