Jquery图片缩放插件:elevatezoom.js

示例

基本缩放

缩放适用于一张或两张图像。建议使用两张图像以使变焦效果最佳。缩放框的大部分设置都可以被覆盖。

色调

您可以轻松设置缩放的色调,您可以将色调叠加的颜色和不透明度设置为任何值

画廊和灯箱

您可以将一组图像附加到缩放中。您也可以将画廊传递到灯箱 新: imageCrossfade 选项将在缩放时同时提供淡入/淡出效果。

窗口位置

可以通过设置默认位置来定位窗口,然后使用 x 和 y 偏移来调整

img

您也可以将窗口定位到容器中

内变焦

缩放可以放在图像内部

镜头变焦

您可以使用镜头变焦设置来“放大图像”。 最少的图像已受到限制,因此它隐藏在图像下方。

淡入淡出

您可以在镜头、窗口和色调上淡入淡出

外部控制

您可以在镜头、窗口和色调上淡入淡出 在下拉菜单中更改图像

Easing

您可以使用默认缓动或自定义缓动设置。缓动量也可以更改 – 默认为 12,设置越高表示越多,越低表示越少

滚动缩放

您可以滚动图像以放大更近!

缩放窗口大小

缩放窗口大小可以调整为任何比例。

使用图像约束缩放

您可以将一组图像附加到缩放中。您也可以将画廊传递给灯箱

配置参数

OptionDefault ValueDesciption
responsivefalseSet to true to activate responsivenes. If you have a theme which changes size, or tablets which change orientation this is needed to be on. Possible Values: "True", "False"
scrollZoomfalseSet to true to activate zoom on mouse scroll. Possible Values: "True", "False"
imageCrossfadefalseSet to true to activate simultaneous crossfade of images on gallery change. Possible Values: "True", "False"
loadingIconfalseSet to the url of the spinner icon to activate, e.g, http://www.example.com/spinner.gif. Possible Values: "True", "False"
easingfalseSet to true to activate easing. Possible Values: "True", "False"
easingTypezoomdefaultdefault easing type is easeOutExpo, (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b Extend jquery with other easing types before initiating the plugin and pass the easing type as a string value.
easingDuration2000
lensSize200used when zoomType set to lens, when zoom type is set to window, then the lens size is auto calculated
zoomWindowWidth400Width of the zoomWindow (Note: zoomType must be “window”)
zoomWindowHeight400Height of the zoomWindow (Note: zoomType must be “window”)
zoomWindowOffetx0x-axis offset of the zoom window
zoomWindowOffety0y-axis offset of the zoom window
zoomWindowPosition1Once positioned, use zoomWindowOffsetx and zoomWindowOffsety to adjust Possible values: 1-16
lensFadeInfalseSet as a number e.g 200 for speed of Lens fadeIn
lensFadeOutfalseSet as a number e.g 200 for speed of Lens fadeOut
zoomWindowFadeInfalseSet as a number e.g 200 for speed of Window fadeIn
zoomWindowFadeOutfalseSet as a number e.g 200 for speed of Window fadeOut
zoomTintFadeInfalseSet as a number e.g 200 for speed of Tint fadeIn
zoomTintFadeOutfalseSet as a number e.g 200 for speed of Tint fadeOut
borderSize4Border Size of the ZoomBox – Must be set here as border taken into account for plugin calculations
zoomLenstrueset to false to hide the Lens
borderColour#888Border Colour
lensBorder1Width in pixels of the lens border
lensShapesquarecan also be round (note that only modern browsers support round, will default to square in older browsers)
zoomTypewindowPossible Values: Lens, Window, Inner
containLensZoomfalsefor use with the Lens Zoom Type. This makes sure the lens does not fall outside the outside of the image
lensColourwhitecolour of the lens background
lensOpacity0.4used in combination with lensColour to make the lens see through. When using tint, this is overrided to 0
lenszoomfalse
tintfalseenable a tint overlay, other options: true
tintColour#333colour of the tint, can be #hex, word (red, blue), or rgb(x, x, x)
tintOpacity0.4opacity of the tint
gallerynullThis assigns a set of gallery links to the zoom image
cursordefaultThe default cursor is usually the arrow, if using a lightbox, then set the cursor to pointer so it looks clickable – Options are default, cursor, crosshair

地址

官网地址:https://www.elevateweb.co.uk/image-zoom/

GitHub:https://github.com/elevateweb/elevatezoom

本文地址:https://www.itcan.cn/2022/04/06/jquery-plugins-elevatezoom/