Zooming instance.
Grab the Element currently opened given a position and apply extra zoom-in.
(number)
The X-axis of where the press happened.
(number)
The Y-axis of where the press happened.
(number?= onEnd = () => {)
Extra zoom-in to apply.
(Function?
= this.options.scaleExtra)
A callback function that
will be called when a target is grabbed and transition has ended. It
will get the target element as the argument.
this:
Move the Element currently grabbed given a position and apply extra zoom-in.
(number)
The X-axis of where the press happened.
(number)
The Y-axis of where the press happened.
(number?= body.style.cursor = cur)
Extra zoom-in to apply.
(Function?
= this.options.scaleExtra)
A callback function that
will be called when a target is moved and transition has ended. It will
get the target element as the argument.
this:
A list of options.
// Default options
var options = {
defaultZoomable: 'img[data-action="zoom"]',
enableGrab: true,
preloadImage: true,
transitionDuration: 0.4,
transitionTimingFunction: 'cubic-bezier(0.4, 0, 0, 1)',
bgColor: 'rgb(255, 255, 255)',
bgOpacity: 1,
scaleBase: 1.0,
scaleExtra: 0.5,
scrollThreshold: 40,
customSize: null,
onOpen: null,
onClose: null,
onRelease: null,
onBeforeOpen: null,
onBeforeClose: null,
onBeforeGrab: null,
onBeforeMove: null,
onBeforeRelease: null
}
Zoomable elements by default. It can be a css selector or an element.
To be able to grab and drag the image for extra zoom-in.
Preload images with attribute "data-original".
Transition duration in seconds.
Transition timing function.
Overlay background color.
Overlay background opacity.
The base scale factor for zooming. By default scale to fit the window.
The extra scale factor when grabbing the image.
How much scrolling it takes before closing out.
Scale (zoom in) to given width and height. Ignore scaleBase if set.
customSize: { width: 800, height: 400 }
A callback function that will be called when a target is opened and transition has ended. It will get the target element as the argument.
Same as above, except fired when closed.
Same as above, except fired when released.
A callback function that will be called before open.
A callback function that will be called before close.
A callback function that will be called before grab.
A callback function that will be called before move.
A callback function that will be called before release.