最新jquery zoom插件

胡俊弼
2023-12-01

http://www.elevateweb.co.uk/image-zoom/examples

Installation and usage

Download the source files (available here) and include the jquery and elevatezoom plugin files into your project

<script  type="text/javascript" src="jquery.js"></script>
<script src="jquery.elevatezoom.js" type="text/javascript"></script>

Include your Image

Elevate Zoom works best using two images, one low resolution for the visible image, and one high resolution for the zoomed image.If you only have one image available, Elevate Zoom will still work if you scale down the image, although this is not recommended as your page load time will increase ifyou are loading larger images

Please ensure your small image is proportionally scaled down from the large image.

<img id="zoom_01" src="small/image1.png" data-zoom-image="large/image1.jpg"/>

Activate the zoom - Basic Example

$("#img_01").elevateZoom();
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"
easingTypezoomdefault

default 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
lensOpacity

0.4

used 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

 类似资料: