美文网首页
2019-07-13:如何正确的使用Swiper

2019-07-13:如何正确的使用Swiper

作者: AI_Finance | 来源:发表于2019-07-13 14:29 被阅读0次
    <!DOCTYPE html>
    <!-- saved from url=(0046)http://www.t230.web.ueeshop.com/?from=timeline -->
    <html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    <meta name="keywords" content="FURNITURE">
    <meta name="description" content="FURNITURE">
    <title>FURNITURE</title>
    <link href="./FURNITURE_files/style.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="./FURNITURE_files/jquery-1.7.2.min.js.下载"></script>
    <script type="text/javascript" src="./FURNITURE_files/main.js.下载"></script>
    <link href="./FURNITURE_files/swiper-3.4.2.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="./FURNITURE_files/swiper-3.4.2.js.下载"></script>
    <script type="text/javascript" src="./FURNITURE_files/index.js.下载"></script>
    </head>
    
    <body class="index lang_en w_1200">
        <div class="index-module index-product">
            <div class="wrap">
                <div class="index-title-0">SPECIAL PRODUCTS</div>
                <div class="list relative">
                    <div class="swiper-iproducts swiper-container swiper-container-horizontal">
                        <div class="swiper-wrapper" style="transform: translate3d(-1320px, 0px, 0px); transition-duration: 0ms;">
                            <div class="swiper-slide text-center swiper-slide-duplicate swiper-slide-duplicate-active" data-swiper-slide-index="0" style="width: 310px; margin-right: 20px;">
                                <div class="img pic over imgZoom"><a href="http://www.t230.web.ueeshop.com/modern-high-wingback-fabric-upholstered-living-room-accent-chair-p00118p1.html"><img src="./FURNITURE_files/52ffdc543e.jpg.500x500.jpg" alt="Modern High Wingback Fabric Upholstered Living Room Accent Chair"></a></div>
                                <a href="http://www.t230.web.ueeshop.com/modern-high-wingback-fabric-upholstered-living-room-accent-chair-p00118p1.html" class="name hoverColor block text-over">Modern High Wingback Fabric Upholstered Living Room Accent Chair</a>
                            </div>
                            <div class="swiper-slide text-center swiper-slide-duplicate swiper-slide-duplicate-next" data-swiper-slide-index="1" style="width: 310px; margin-right: 20px;">
                                <div class="img pic over imgZoom"><a href="http://www.t230.web.ueeshop.com/farm-60-dining-table-p00104p1.html"><img src="./FURNITURE_files/499f873b4e.jpg.500x500.jpg" alt="Farm 60" dining="" table"=""></a></div>
                                <a href="http://www.t230.web.ueeshop.com/farm-60-dining-table-p00104p1.html" class="name hoverColor block text-over">Farm 60" Dining Table</a>
                            </div>
                            <div class="swiper-slide text-center swiper-slide-duplicate" data-swiper-slide-index="2" style="width: 310px; margin-right: 20px;">
                                <div class="img pic over imgZoom"><a href="http://www.t230.web.ueeshop.com/task-lamp-room-essentials-p00127p1.html"><img src="./FURNITURE_files/5c8c1bc61b.jpg.500x500.jpg" alt="Task Lamp - Room Essentials"></a></div>
                                <a href="http://www.t230.web.ueeshop.com/task-lamp-room-essentials-p00127p1.html" class="name hoverColor block text-over">Task Lamp - Room Essentials</a>
                            </div>
                        </div>
                    </div>
                    <div class="swiper-hd text-center">
                        <div class="ipro-button-prev lb pointer"></div>
                        <div class="ipro-button-next rb pointer"></div>
                    </div>
                </div>
            </div>
        </div>
    
    </body></html>
    

    对应的javascripts脚本如下:

    
    $(function(){
        var iProductBanner = new Swiper('.swiper-iproducts', {
            prevButton:'.ipro-button-prev',
            nextButton:'.ipro-button-next',
            loop:true,
            slidesPerView: 4,
            spaceBetween: 20,
            breakpoints: {
                992: { slidesPerView: 3, spaceBetween: 30 },
                640: { slidesPerView: 2, spaceBetween: 20 }
            }
        });
    
        var caseSwiper = new Swiper('.swiper-icase', {
            //prevButton:'.ica-button-prev',
            //nextButton:'.ica-button-next',
            slidesPerView: 5,
            slidesPerColumn: 2,
            /*paginationClickable: true,
            spaceBetween: 30*/
            noSwiping : true,
            breakpoints: {
                //992: { slidesPerView: 3,slidesPerColumn: 5 },
                768: { slidesPerView: 2,slidesPerColumn: 5 }
            }
        });
    });
    

    相关文章

      网友评论

          本文标题:2019-07-13:如何正确的使用Swiper

          本文链接:https://www.haomeiwen.com/subject/vttmkctx.html