Replies: 2 comments
-
|
Alternatively, I'm wondering if anyone has had any success building custom zoom instead of using the |
Beta Was this translation helpful? Give feedback.
-
|
Update: I wasn't able to come up with a working solution to this particular problem. Despite using I know this isn't much of a "solution" for anyone else who may stumble across this discussion, but at least it may save you some time. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm not sure if this should be considered a bug, yet it doesn't necessarily feel like a feature request either. Maybe I'm just missing something obvious.
Earlier this year I built a mobile product image slider for a client and, for a variety of reasons, it essentially contains all images for all product variants. All slides initially have a class that hides them by default and then based on color, material, or size selections made elsewhere on the page the relevant slides will dynamically toggle that class on or off. Additionally, when any of those selections are made we're updating the slider with
swiper.update().Imagine a slider that has like 100 slides but only 5-10 of them are actually visible at any given time. It's a little wacky but the end result works well. We were also able to utilize standard modules like navigation and pagination without issue.
Recently I've been working on a new feature that allows users to zoom in and pan around on larger, more detailed versions of the same images. For the most part all of this work was accomplished without issue - and then a request came in after the fact to add -/+ buttons to make it clearer than zooming functionality exists.
I created these buttons and got them all wired up using
swiper.zoom.in()andswiper.zoom.out(), but they didn't seem to be actually working. I didn't understand why at first until I started to debug using thezoomChangeevent.It turns out that an unintended result of visually hiding/showing slides is that the prev/active/next classes never move around. So they're initially set on the first DOM nodes and then the zoom functionality I'm looking for is being executed on whatever slide has the active class.
Is there a built-in way of accounting for this or do I need to come up with some sort of custom solution to fit my needs?
Beta Was this translation helpful? Give feedback.
All reactions