Skip to content

Fancybox Zoom buttons? #58

Answered by fancyapps
wlsquid asked this question in Q&A
Aug 12, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hi,

This way you can access the current slide and the Panzoom instance created by the image plugin -

Fancybox.getInstance().getSlide().Panzoom

You can then call any Panzoom method (zoomIn()/zoomOut()/toggleZoom()), example:

Fancybox.getInstance().getSlide().Panzoom.toggleZoom();

Those buttons are created by Controls plugin of the Panzoom and it is not included by default. Simply include appropriate CSS and JS files and then register the plugin -

Panzoom.Plugins = {
  Controls,
};

Demo - https://fancyapps.com/playground/zY

But I think you might better want to add zoom in/out buttons in the toolbar, see this demo - https://fancyapps.com/playground/zZ

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wlsquid
Comment options

Answer selected by wlsquid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants