zoukankan      html  css  js  c++  java
  • swiper轮播箭头垂直居中

    取消懒加载


    for (var i in $('.p01-s9 .lazyload')) {
    $('.p01-s9 .lazyload').eq(i).attr('src',$('.p01-s9 .lazyload').eq(i).attr('data-src'));
    }
    $('.p01-s9 .lazyload').removeClass('lazyload').addClass('lazyloaded');


    //轮播箭头垂直居中
    function reactiveGallaryArrowTop($swiper) {

    var outerHeight = $($swiper).find(".swiper-wrapper").height();
    var imgHeight = $($swiper).find(".swiper-slide").find("img").height();
    var percentage = 0.5*imgHeight/outerHeight * 100;

    var prevArrow = $($swiper).find(".prev");
    var nextArrow = $($swiper).find(".next");

    prevArrow.css({
    "top": percentage + '%'
    });
    nextArrow.css({
    "top": percentage + '%'
    });
    }
    //swiper调用
                on: {
                    imagesReady: function(){

          reactiveGallaryArrowTop('#p01-s5');                    

                    }
                }

     
            $(window).resize(function () {
                reactiveGallaryArrowTop('.p11-1-s4');
            });
  • 相关阅读:
    Python -- Redis List
    Python --Redis Hash操作
    Python使用redis介绍
    缓存服务器
    linux python3获取ip地址
    Rabbitmq -- rpc
    Rabbitmq--topic
    Rabbitmq -- direct
    删除rabbitmq中持久化的队列和数据
    Exchange-fanout 广播模式
  • 原文地址:https://www.cnblogs.com/gduf/p/11679349.html
Copyright © 2011-2022 走看看