dimsemenov / PhotoSwipe

JavaScript image gallery for mobile and desktop, modular, framework independent
http://photoswipe.com
MIT License
24.12k stars 3.31k forks source link

PhotoSwipe with SlickSlider #1248

Open WebCustoms opened 7 years ago

WebCustoms commented 7 years ago

Hello,

First of all, you have a nice plugin.

I use it in combination with the jquery plugin slick (http://kenwheeler.github.io/slick/) with single items.

Example:

gallery.listen('afterChange', function () { $('.product-main-image').slick('slickGoTo', gallery.getCurrentIndex()); });

If I slide with PhotoSwip, then I let the slick slider slide over the listener "afterChange".

When closing PhotoSwipe, it is scaled to the now hidden element. It should reduce to the current element.

Here is a video as an example: http://www.screencast.com/t/0uo4xK5CRHNG

Is there the possibility that when closing then photoswipe reduces to the changed image?

Sorry for my bad english.

grimxd commented 7 years ago

I am looking for similar thing. I am using Swiper in combination with Photoswipe . I am using Photoswipe to expand (maximize) photos in Swiper slides. When I close Photoswipe I want to return to the Swiper slide with the photo I just closed in Photoswipe. (Similar like in the @richcom 's video provided above)

Juni4567 commented 6 years ago

Here is a slick and photoswipe cool gallery 6152d0e79ce2d3c6a7f5b305b0a88599

gavsiu commented 6 years ago

Also looking for a solution to this PhotoSwipe + Slick issue. The slides normally don't sync up and when you close PhotoSwipe, Slick stays the same.

I tried inserting the afterChange event near the bottom of photoswipe-ui.js, but instead of changing the Slick slide position, it caused PhotoSwipe to advance the slide position by the index number.

Let's say I set it to change to slide 2 manually on my Slick slider, it causes PhotoSwipe to go to the next 2 slides.

Closing PhotoSwipe, Slick slider remains unchanged.