Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to display a partial view of the next slide? #530

Open
gxxcastillo opened this issue Mar 8, 2017 · 4 comments
Open

How to display a partial view of the next slide? #530

gxxcastillo opened this issue Mar 8, 2017 · 4 comments

Comments

@gxxcastillo
Copy link

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.

@lianer
Copy link

lianer commented Mar 13, 2017

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

@heshamghandour
Copy link

How was it done?

@lianer
Copy link

lianer commented Apr 3, 2017

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
Copy link

lianer commented Apr 5, 2017

@heshamghandour

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants