Open gmelikov opened 8 years ago
I believe it's to do with intercepting the touches[]
and preventing the default behaviour... you can try to prevent this by detecting (on touch start) if the e.originalEvent.changedTouches[]
array has more than one entry, and disabling the carousel temporarily until a touchEnd event... this should allow pinch-zooming. (I think... I've done this before but with a ton more effort as I needed a custom-zoom feature which I implemented with Hammer.js)
@simeydotme nice!
Any solutions to this problem?
@ #1188
Remove these lines in slick.scss:
-ms-touch-action: pan-y; touch-action: pan-y;
removing the touch-action property may enable the zoom but the user cannot scroll and see the left and right most part of the image when it is zoomed.
@nexxome this does nothing for me. Is there something I'm overlooking here?
@gmelikov I don't know if you still need a solution for this, but what I did and works was changing the CSS in the class:
".slick-slider": { touchAction: "auto", } ,
I am using styled components, that explain syntax I am using here, in this way yo don't lose scroll or swipe.
Hope this helps somebody.
Do we have the ability to set these options at initialization?
I have a scenario where we have to sliders on page, one where we want to be able to pinch-zoom and the other where we don't. Being able to pass in the pan-x, pan-y, touch-action, etc. options and not having to maintain two different css files would be ideal.
@gmelikov I don't know if you still need a solution for this, but what I did and works was changing the CSS in the class:
".slick-slider": { touchAction: "auto", } ,
I am using styled components, that explain syntax I am using here, in this way yo don't lose scroll or swipe.Hope this helps somebody.
This didn't work for me... is there an example you can share?
Does anyone have a solution?
I found this snippet on another page which allows you to pinch and zoom, but for me it was enabling it on the whole site not just the slide:
<style>
.slick-slider {
touch-action: auto !important;
}
</style>
Try use https://www.jqueryscript.net/zoom/jQuery-Plugin-For-Panning-Zooming-Any-Elements-panzoom.html with this carousel
Thanks for the help from 2023 :) For me
.slick-slider {
touch-action: auto;
}
worked perfect. I implemented it as class modifier in the CSS file of the component that renders
The page zoomed
What is observed behaviour?
The page didn't zoom in.
More Details
Maybe i missed some settings for this feature?
Thanks!