Swipe icon indicating copy to clipboard operation
Swipe copied to clipboard

How to display a partial view of the next slide?

Open gxxcastillo opened this issue 8 years ago • 4 comments

Hi,

How would I go about showing a partial view of the next slide? In my case, I'm swiping left and I want the slide that's to the right of my current slide to be partially visible.

gxxcastillo avatar Mar 08 '17 06:03 gxxcastillo

like this? https://wy.guahao.com/askeveryday/index

lianer avatar Mar 13 '17 03:03 lianer

How was it done?

heshamghandour avatar Apr 02 '17 22:04 heshamghandour

This is one part of the Code.

vm.swiper = new Swiper3(vm.$els.swiperContainer, {
  speed: 500,
  loop: true,
  slidesPerView: "auto",
  spaceBetween: 12,
  autoplay: 3000,
  autoplayDisableOnInteraction : false,
  onSlideChangeStart: function (swiper) {
    // chang opacity
    var slide = $(swiper.slides[swiper.activeIndex]);
    var index = ~~slide.data("swiperSlideIndex");
    var container = $(swiper.container[0]);
    container.find(".swiper-slide").removeClass("active")
      .filter("[data-swiper-slide-index='" + index + "']")
      .addClass("active");
    vm.index = index;
  },
});
@ratio: 16rem / 750;
.swiper-container{
  height: 432 * @ratio;
  padding: 0 12px;
  overflow: hidden;
  .swiper-slide{
    position: relative;
    width: 680 * @ratio;
    height: 432 * @ratio;
    overflow: hidden;
    opacity: .3;
    transition: opacity .5s ease-out;
    &.active{
      opacity: 1;
    }
  }
}

lianer avatar Apr 03 '17 04:04 lianer

@heshamghandour

lianer avatar Apr 05 '17 01:04 lianer