Fancybox / Panzoom toggle class when zoomed #532
Unanswered
addedlovely
asked this question in
Q&A
Replies: 1 comment
-
Hi, Here is an example on how to listen to Panzoom events: Fancybox.bind('[data-fancybox="gallery"]', {
Images : {
Panzoom : {
on : {
"*": (panzoom, eventName) => {
console.log(`panzoom eventName: ${eventName}; current level: ${panzoom.scale}`);
},
}
}
},
}); Demo - https://jsfiddle.net/8gorjed7/
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello.
Is there an event I can bind to when an image has been zoomed in via panzoom. In my use case, I just want to toggle a CSS class on/off if when the zoom is activated.
Checking over the events that are fired with the below, there doesn't seem to be one that simply emits when the image is zoomed.
Likewise there doesn't seem to be method on Panzoom to read the current zoom level, unless I'm missing that?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions