1/* jQuery elevateZoom 3.0.8 - Demo's and documentation: - www.elevateweb.co.uk/image-zoom - Copyright (c) 2013 Andrew Eades - www.elevateweb.co.uk - Dual licensed under the LGPL licenses. - http://en.wikipedia.org/wiki/MIT_License - http://en.wikipedia.org/wiki/GNU_General_Public_License */ 2/* Modified by Artlogic */ 3"function" !== typeof Object.create && (Object.create = function(d) { 4 function h() {} 5 h.prototype = d; 6 return new h 7}); 8(function(d, h, l, m) { 9 var k = { 10 init: function(b, a) { 11 var c = this; 12 c.elem = a; 13 c.$elem = d(a); 14 c.imageSrc = c.$elem.data("zoom-image") ? c.$elem.data("zoom-image") : c.$elem.attr("src"); 15 c.options = d.extend({}, d.fn.elevateZoom.options, b); 16 c.options.tint && (c.options.lensColour = "none", c.options.lensOpacity = "1"); 17 "inner" == c.options.zoomType && (c.options.showLens = !1); 18 c.$elem.parent().removeAttr("title").removeAttr("alt"); 19 c.zoomImage = c.imageSrc; 20 c.refresh(1); 21 d("#" + c.options.gallery + " a").click(function(a) { 22 c.options.galleryActiveClass && 23 (d("#" + c.options.gallery + " a").removeClass(c.options.galleryActiveClass), d(this).addClass(c.options.galleryActiveClass)); 24 a.preventDefault(); 25 d(this).data("zoom-image") ? c.zoomImagePre = d(this).data("zoom-image") : c.zoomImagePre = d(this).data("image"); 26 c.swaptheimage(d(this).data("image"), c.zoomImagePre); 27 return !1 28 }) 29 }, 30 refresh: function(b) { 31 var a = this; 32 setTimeout(function() { 33 a.fetch(a.imageSrc) 34 }, b || a.options.refresh) 35 }, 36 fetch: function(b) { 37 var a = this, 38 c = new Image; 39 c.onload = function() { 40 a.largeWidth = c.width; 41 a.largeHeight = c.height; 42 43 // Modified 44 // Increase the proportions of the zoom image if it is not big enough to visually show a zoom effect 45 // This fixes the zoom when the image is *smaller* than the container 46 var zoom_container_width = a.$elem.width(); 47 var zoom_container_height = a.$elem.height(); 48 var ratio_to_increase_width = (zoom_container_width / a.largeWidth) * 2; 49 var ratio_to_increase_height = (zoom_container_height / a.largeHeight) * 2; 50 if (ratio_to_increase_width > 1) { 51 a.largeWidth = a.largeWidth * ratio_to_increase_width; 52 a.largeHeight = a.largeHeight * ratio_to_increase_width; 53 } else if (ratio_to_increase_height > 1) { 54 a.largeWidth = a.largeWidth * ratio_to_increase_height; 55 a.largeHeight = a.largeHeight * ratio_to_increase_height; 56 } 57 58 a.startZoom(); 59 a.currentImage = a.imageSrc; 60 a.options.onZoomedImageLoaded(a.$elem) 61 }; 62 c.src = b 63 }, 64 startZoom: function() { 65 var b = this; 66 b.nzWidth = b.$elem.width(); 67 b.nzHeight = b.$elem.height(); 68 b.isWindowActive = !1; 69 b.isLensActive = !1; 70 b.isTintActive = !1; 71 b.overWindow = !1; 72 b.options.imageCrossfade && (b.zoomWrap = b.$elem.wrap('<div style="height:' + b.nzHeight + "px;width:" + b.nzWidth + 'px;" class="zoomWrapper" />'), b.$elem.css("position", "absolute")); 73 b.zoomLock = 1; 74 b.scrollingLock = !1; 75 b.changeBgSize = !1; 76 b.currentZoomLevel = b.options.zoomLevel; 77 b.nzOffset = b.$elem.offset(); 78 b.widthRatio = b.largeWidth / b.currentZoomLevel / b.nzWidth; 79 b.heightRatio = b.largeHeight / b.currentZoomLevel / b.nzHeight; 80 "window" == b.options.zoomType && (b.zoomWindowStyle = "overflow: hidden;background-position: 0px 0px;text-align:center;background-color: " + String(b.options.zoomWindowBgColour) + ";width: " + String(b.options.zoomWindowWidth) + "px;height: " + String(b.options.zoomWindowHeight) + "px;float: left;background-size: " + b.largeWidth / b.currentZoomLevel + "px " + b.largeHeight / b.currentZoomLevel + 81 "px;display: none;z-index:100;border: " + String(b.options.borderSize) + "px solid " + b.options.borderColour + ";background-repeat: no-repeat;position: absolute;"); 82 if ("inner" == b.options.zoomType) { 83 var a = b.$elem.css("border-left-width"); 84 b.zoomWindowStyle = "overflow: hidden;margin-left: " + String(a) + ";margin-top: " + String(a) + ";background-position: 0px 0px;width: " + String(b.nzWidth) + "px;height: " + String(b.nzHeight) + "px;float: left;display: none;cursor:" + b.options.cursor + ";px solid " + b.options.borderColour + ";background-repeat: no-repeat;position: absolute;background-size:" + (b.widthRatio * 100) + "% auto;" 85 } 86 "window" == 87 b.options.zoomType && (lensHeight = b.nzHeight < b.options.zoomWindowWidth / b.widthRatio ? b.nzHeight :
87String(b.options.zoomWindowHeight / b.heightRatio), lensWidth = b.largeWidth < b.options.zoomWindowWidth ? b.nzWidth : b.options.zoomWindowWidth / b.widthRatio, b.lensStyle = "background-position: 0px 0px;width: " + String(b.options.zoomWindowWidth / b.widthRatio) + "px;height: " + String(b.options.zoomWindowHeight / b.heightRatio) + "px;float: right;display: none;overflow: hidden;z-index: 999;-webkit-transform: translateZ(0);opacity:" + 88 b.options.lensOpacity + ";filter: alpha(opacity = " + 100 * b.options.lensOpacity + "); zoom:1;width:" + lensWidth + "px;height:" + lensHeight + "px;background-color:" + b.options.lensColour + ";cursor:" + b.options.cursor + ";border: " + b.options.lensBorderSize + "px solid " + b.options.lensBorderColour + ";background-repeat: no-repeat;position: absolute;"); 89 b.tintStyle = "display: block;position: absolute;background-color: " + b.options.tintColour + ";filter:alpha(opacity=0);opacity: 0;width: " + b.nzWidth + "px;height: " + b.nzHeight + "px;"; 90 b.lensRound = ""; 91 "lens" == b.options.zoomType && (b.lensStyle = "background-position: 0px 0px;float: left;display: none;border: " + String(b.options.borderSize) + "px solid " + b.options.borderColour + ";width:" + String(b.options.lensSize) + "px;height:" + String(b.options.lensSize) + "px;background-repeat: no-repeat;position: absolute;"); 92 "round" == b.options.lensShape && (b.lensRound = "border-top-left-radius: " + String(b.options.lensSize / 2 + b.options.borderSize) + "px;border-top-right-radius: " + String(b.options.lensSize / 2 + b.options.borderSize) + 93 "px;border-bottom-left-radius: " + String(b.options.lensSize / 2 + b.options.borderSize) + "px;border-bottom-right-radius: " + String(b.options.lensSize / 2 + b.options.borderSize) + "px;"); 94 b.zoomContainer = d('<div class="zoomContainer" style="-webkit-transform: translateZ(0);position:absolute;left:' + b.nzOffset.left + "px;top:" + b.nzOffset.top + "px;height:" + b.nzHeight + "px;width:" + b.nzWidth + 'px;"></div>'); 95 d("body").append(b.zoomContainer); 96 b.options.containLensZoom && "lens" == b.options.zoomType && b.zoomContainer.css("overflow", 97 "hidden"); 98 "inner" != b.options.zoomType && (b.zoomLens = d("<div class='zoomLens' style='" + b.lensStyle + b.lensRound + "'> </div>").appendTo(b.zoomContainer).click(function() { 99 b.$elem.trigger("click") 100 }), b.options.tint && (b.tintContainer = d("<div/>").addClass("tintContainer"), b.zoomTint = d("<div class='zoomTint' style='" + b.tintStyle + "'></div>"), b.zoomLens.wrap(b.tintContainer), b.zoomTintcss = b.zoomLens.after(b.zoomTint), b.zoomTintImage = d('<img style="position: absolute; left: 0px; top: 0px; max-width: none; width: ' + 101 b.nzWidth + "px; height: " + b.nzHeight + 'px;" src="' + b.imageSrc + '">').appendTo(b.zoomLens).click(function() { 102 b.$elem.trigger("click") 103 }))); 104 isNaN(b.options.zoomWindowPosition) ? b.zoomWindow = d("<div style='z-index:999;left:" + b.windowOffsetLeft + "px;top:" + b.windowOffsetTop + "px;" + b.zoomWindowStyle + "' class='zoomWindow'> </div>").appendTo("body").click(function() { 105 b.$elem.trigger("click") 106 }) : b.zoomWindow = d("<div style='z-index:999;left:" + b.windowOffsetLeft + "px;top:" + b.windowOffsetTop + "px;" + b.zoomWindowStyle + 107 "' class='zoomWindow'> </div>").appendTo(b.zoomContainer).click(function() { 108 b.$elem.trigger("click") 109 }); 110 if ("inner" == b.options.zoomType) { 111 b.zoomWindowContainer = d("<div/>").addClass("zoomWindowContainer").css("width", '100%'); 112 } else { 113 b.zoomWindowContainer = d("<div/>").addClass("zoomWindowContainer").css("width", b.options.zoomWindowWidth); 114 } 115 b.zoomWindow.wrap(b.zoomWindowContainer); 116 "lens" == b.options.zoomType && b.zoomLens.css({ 117 backgroundImage: "url('" + b.imageSrc + "')" 118 }); 119 "window" == b.options.zoomType && b.zoomWindow.css({ 120 backgroundImage: "url('" + b.imageSrc + "')" 121 }); 122 "inner" == b.options.zoomType && b.zoomWindow.css({ 123 backgroundImage: "url('" + b.imageSrc + 124 "')" 125 }); 126 b.$elem.bind("touchmove", function(a) { 127 a.preventDefault(); 128 b.setPosition(a.originalEvent.touches[0] || a.originalEvent.changedTouches[0]) 129 }); 130 b.zoomContainer.bind("touchmove", function(a) { 131 "inner" == b.options.zoomType && b.showHideWindow("show"); 132 a.preventDefault(); 133 b.setPosition(a.originalEvent.touches[0] || a.originalEvent.changedTouches[0]) 134 }); 135 b.zoomContainer.bind("touchend", function(a) { 136 b.showHideWindow("hide"); 137 b.options.showLens && b.showHideLens("hide"); 138 b.options.tint && "inner" != b.options.zoomType && b.showHideTint("hide") 139 }); 140 b.$elem.bind("touchend", function(a) { 141 b.showHideWindow("hide"); 142 b.options.showLens && b.showHideLens("hide"); 143 b.options.tint && "inner" != b.options.zoomType && b.showHideTint("hide") 144 }); 145 b.options.showLens && (b.zoomLens.bind("touchmove", function(a) { 146 a.preventDefault(); 147 b.setPosition(a.originalEvent.touches[0] || a.originalEvent.changedTouches[0]) 148 }), b.zoomLens.bind("touchend", function(a) { 149 b.showHideWindow("hide"); 150 b.options.showLens && b.showHideLens("hide"); 151 b.options.tint && "inner" != b.options.zoomType && b.showHideTint("hide") 152 })); 153 b.$elem.bind("mousemove", function(a) { 154 !1 == b.overWindow && b.setElements("show"); 155 if (b.lastX !== a.clientX || b.lastY !== a.clientY) b.setPosition(a), b.currentLoc = a; 156 b.lastX = a.clientX; 157 b.lastY = a.clientY 158 }); 159 b.zoomContainer.bind("mousemove", function(a) { 160 !1 == b.overWindow && b.setElements("show"); 161 if (b.lastX !== a.clientX || b.lastY !== a.clientY) b.setPosition(a), b.currentLoc = a; 162 b.lastX = a.clientX; 163 b.lastY = a.clientY 164 }); 165 "inner" != b.options.zoomType && b.zoomLens.bind("mousemove", function(a) { 166 if (b.lastX !== a.clientX || b.lastY !== a.clientY) b.setPosition(a), 167 b.currentLoc = a; 168 b.lastX = a.clientX; 169 b.lastY = a.clientY 170 }); 171 b.options.tint && "inner" != b.options.zoomType && b.zoomTint.bind("mousemove", function(a) { 172 if (b.lastX !== a.clientX || b.lastY !== a.clientY) b.setPosition(a), b.currentLoc = a; 173 b.lastX = a.clientX; 174 b.lastY = a.clientY 175 }); 176 "inner" == b.options.zoomType && b.zoomWindow.bind("mousemove", function(a) { 177 if (b.lastX !== a.clientX || b.lastY !== a.clientY) b.setPosition(a), b.currentLoc = a; 178 b.lastX = a.clientX; 179 b.lastY = a.clientY 180 }); 181 b.zoomContainer.add(b.$elem).mouseenter(function() { 182 !1 == b.overWindow && 183 b.setElements("show") 184 }).mouseleave(function() { 185 b.scrollLock || b.setElements("hide") 186 }); 187 "inner" != b.options.zoomType && b.zoomWindow.mouseenter(function() { 188 b.overWindow = !0; 189 b.setElements("hide") 190 }).mouseleave(function() { 191 b.overWindow = !1 192 }); 193 b.minZoomLevel = b.options.minZoomLevel ? b.options.minZoomLevel : 2 * b.options.scrollZoomIncrement; 194 b.options.scrollZoom && b.zoomContainer.add(b.$elem).bind("mousewheel DOMMouseScroll MozMousePixelScroll", function(a) { 195 b.scrollLock = !0; 196 clearTimeout(d.data(this, "timer")); 197 d.data(this, "timer", 198 setTimeout(function() { 199 b.scrollLock = !1 200 }, 250)); 201 var e = a.originalEvent.wheelDelta || -1 * a.originalEvent.detail; 202 a.stopImmediatePropagation(); 203 a.stopPropagation(); 204 a.preventDefault(); 205 0 < e / 120 ? b.currentZoomLevel >= b.minZoomLevel && b.changeZoomLevel(b.currentZoomLevel - b.options.scrollZoomIncrement) : b.options.maxZoomLevel ? b.currentZoomLevel <= b.options.maxZoomLevel && b.changeZoomLevel(parseFloat(b.currentZoomLevel) + b.options.scrollZoomIncrement) : b.changeZoomLevel(parseFloat(b.currentZoomLevel) + b.options.scrollZoomIncrement); 206 return !1 207 }) 208 }, 209 setElements: function(b) { 210 if (!this.options.zoomEnabled) return !1; 211 "show" == b && this.isWindowSet && ("inner" == this.options.zoomType && this.showHideWindow("show"), "window" == this.options.zoomType && this.showHideWindow("show"), this.options.showLens && this.showHideLens("show"), this.options.tint && "inner" != this.options.zoomType && this.showHideTint("show")); 212 "hide" == b && ("window" == this.options.zoomType && this.showHideWindow("hide"), this.options.tint || this.showHideWindow("hide"), this.options.showLens && this.showHideLens("hide"), 213 this.options.tint && this.showHideTint("hide")) 214 }, 215 setPosition: function(b) { 216 if (!this.options.zoomEnabled) return !1; 217 this.nzHeight = this.$elem.height(); 218 this.nzWidth = this.$elem.width(); 219 this.nzOffset = this.$elem.offset(); 220 this.options.tint && "inner" != this.options.zoomType && (this.zoomTint.css({ 221 top: 0 222 }), this.zoomTint.css({ 223 left: 0 224 })); 225 this.options.responsive && !this.options.scrollZoom && this.options.showLens && (lensHeight = this.nzHeight < this.options.zoomWindowWidth / this.widthRatio ? this.nzHeight :
225String(this.options.zoomWindowHeight / 226 this.heightRatio), lensWidth = this.largeWidth < this.options.zoomWindowWidth ? this.nzWidth : this.options.zoomWindowWidth / this.widthRatio, this.widthRatio = this.largeWidth / this.nzWidth, this.heightRatio = this.largeHeight / this.nzHeight, "lens" != this.options.zoomType && (lensHeight = this.nzHeight < this.options.zoomWindowWidth / this.widthRatio ? this.nzHeight : String(this.options.zoomWindowHeight / this.heightRatio), lensWidth = this.options.zoomWindowWidth < this.options.zoomWindowWidth ? this.nzWidth : this.options.zoomWindowWidth / 227 this.widthRatio, this.zoomLens.css("width", lensWidth), this.zoomLens.css("height", lensHeight), this.options.tint && (this.zoomTintImage.css("width", this.nzWidth), this.zoomTintImage.css("height", this.nzHeight))), "lens" == this.options.zoomType && this.zoomLens.css({ 228 width: String(this.options.lensSize) + "px", 229 height: String(this.options.lensSize) + "px" 230 })); 231 this.zoomContainer.css({ 232 top: this.nzOffset.top 233 }); 234 this.zoomContainer.css({ 235 left: this.nzOffset.left 236 }); 237 this.mouseLeft = parseInt(b.pageX - this.nzOffset.left); 238 this.mouseTop = 239 parseInt(b.pageY - this.nzOffset.top); 240 "window" == this.options.zoomType && (this.Etoppos = this.mouseTop < this.zoomLens.height() / 2, this.Eboppos = this.mouseTop > this.nzHeight - this.zoomLens.height() / 2 - 2 * this.options.lensBorderSize, this.Eloppos = this.mouseLeft < 0 + this.zoomLens.width() / 2, this.Eroppos = this.mouseLeft > this.nzWidth - this.zoomLens.width() / 2 - 2 * this.options.lensBorderSize); 241 "inner" == this.options.zoomType && (this.Etoppos = this.mouseTop < this.nzHeight / 2 / this.heightRatio, this.Eboppos = this.mouseTop > this.nzHeight - 242 this.nzHeight / 2 / this.heightRatio, this.Eloppos = this.mouseLeft < 0 + this.nzWidth / 2 / this.widthRatio, this.Eroppos = this.mouseLeft > this.nzWidth - this.nzWidth / 2 / this.widthRatio - 2 * this.options.lensBorderSize); 243 0 >= this.mouseLeft || 0 > this.mouseTop || this.mouseLeft > this.nzWidth || this.mouseTop > this.nzHeight ? this.setElements("hide") : (this.options.showLens && (this.lensLeftPos = String(this.mouseLeft - this.zoomLens.width() / 2), this.lensTopPos = String(this.mouseTop - this.zoomLens.height() / 2)), this.Etoppos && (this.lensTopPos = 0), 244 this.Eloppos && (this.tintpos = this.lensLeftPos = this.windowLeftPos = 0), "window" == this.options.zoomType && (this.Eboppos && (this.lensTopPos = Math.max(this.nzHeight - this.zoomLens.height() - 2 * this.options.lensBorderSize, 0)), this.Eroppos && (this.lensLeftPos = this.nzWidth - this.zoomLens.width() - 2 * this.options.lensBorderSize)), "inner" == this.options.zoomType && (this.Eboppos && (this.lensTopPos = Math.max(this.nzHeight - 2 * this.options.lensBorderSize, 0)), this.Eroppos && (this.lensLeftPos = this.nzWidth - this.nzWidth - 2 * this.options.lensBorderSize)), 245 "lens" == this.options.zoomType && (this.windowLeftPos = String(-1 * ((b.pageX - this.nzOffset.left) * this.widthRatio - this.zoomLens.width() / 2)), this.windowTopPos = String(-1 * ((b.pageY - this.nzOffset.top) * this.heightRatio - this.zoomLens.height() / 2)), this.zoomLens.css({ 246 backgroundPosition: this.windowLeftPos + "px " + this.windowTopPos + "px" 247 }), this.changeBgSize && (this.nzHeight > this.nzWidth ? ("lens" == this.options.zoomType && this.zoomLens.css({ 248 "background-size": this.largeWidth / this.newvalueheight + "px " + this.largeHeight / this.newvalueheight + 249 "px" 250 }), this.zoomWindow.css({ 251 "background-size": this.largeWidth / this.newvalueheight + "px " + this.largeHeight / this.newvalueheight + "px" 252 })) : ("lens" == this.options.zoomType && this.zoomLens.css({ 253 "background-size": this.largeWidth / this.newvaluewidth + "px " + this.largeHeight / this.newvaluewidth + "px" 254 }), this.zoomWindow.css({ 255 "background-size": this.largeWidth / this.newvaluewidth + "px " + this.largeHeight / this.newvaluewidth + "px" 256 })), this.changeBgSize = !1), this.setWindowPostition(b)), this.options.tint && "inner" != this.options.zoomType && 257 this.setTintPosition(b), "window" == this.options.zoomType && this.setWindowPostition(b), "inner" == this.options.zoomType && this.setWindowPostition(b), this.options.showLens && (this.fullwidth && "lens" != this.options.zoomType && (this.lensLeftPos = 0), this.zoomLens.css({ 258 left: this.lensLeftPos + "px", 259 top: this.lensTopPos + "px" 260 }))) 261 }, 262 showHideWindow: function(b) { 263 "show" != b || this.isWindowActive || (this.options.zoomWindowFadeIn ? this.zoomWindow.stop(!0, !0, !1).fadeIn(this.options.zoomWindowFadeIn) : this.zoomWindow.show(), this.isWindowActive = !0); 264 "hide" == b && this.isWindowActive && (this.options.zoomWindowFadeOut ? this.zoomWindow.stop(!0, !0).fadeOut(this.options.zoomWindowFadeOut) : this.zoomWindow.hide(), this.isWindowActive = !1) 265 }, 266 showHideLens: function(b) { 267 "show" != b || this.isLensActive || (this.options.lensFadeIn ? this.zoomLens.stop(!0, !0, !1).fadeIn(this.options.lensFadeIn) : this.zoomLens.show(), this.isLensActive = !0); 268 "hide" == b && this.isLensActive && (this.options.lensFadeOut ? this.zoomLens.stop(!0, !0).fadeOut(this.options.lensFadeOut) : this.zoomLens.hide(), 269 this.isLensActive = !1) 270 }, 271 showHideTint: function(b) { 272 "show" != b || this.isTintActive || (this.options.zoomTintFadeIn ? this.zoomTint.css({ 273 opacity: this.options.tintOpacity 274 }).animate().stop(!0, !0).fadeIn("slow") : (this.zoomTint.css({ 275 opacity: this.options.tintOpacity 276 }).animate(), this.zoomTint.show()), this.isTintActive = !0); 277 "hide" == b && this.isTintActive && (this.options.zoomTintFadeOut ? this.zoomTint.stop(!0, !0).fadeOut(this.options.zoomTintFadeOut) : this.zoomTint.hide(), this.isTintActive = !1) 278 }, 279 setLensPostition: function(b) {}, 280 setWindowPostition: function(b) { 281 var a = this; 282 if (isNaN(a.options.zoomWindowPosition)) a.externalContainer = d("#" + a.options.zoomWindowPosition), a.externalContainerWidth = a.externalContainer.width(), a.externalContainerHeight = a.externalContainer.height(), a.externalContainerOffset = a.externalContainer.offset(), a.windowOffsetTop = a.externalContainerOffset.top, a.windowOffsetLeft = a.externalContainerOffset.left; 283 else switch (a.options.zoomWindowPosition) { 284 case 1: 285 a.windowOffsetTop = a.options.zoomWindowOffety; 286 a.windowOffsetLeft = +a.nzWidth; 287 break; 288 case 2: 289 a.options.zoomWindowHeight > a.nzHeight && (a.windowOffsetTop = -1 * (a.options.zoomWindowHeight / 2 - a.nzHeight / 2), a.windowOffsetLeft = a.nzWidth); 290 break; 291 case 3: 292 a.windowOffsetTop = a.nzHeight - a.zoomWindow.height() - 2 * a.options.borderSize; 293 a.windowOffsetLeft = a.nzWidth; 294 break; 295 case 4: 296 a.windowOffsetTop = a.nzHeight; 297 a.windowOffsetLeft = a.nzWidth; 298 break; 299 case 5: 300 a.windowOffsetTop = a.nzHeight; 301 a.windowOffsetLeft = a.nzWidth - a.zoomWindow.width() - 2 * a.options.borderSize; 302 break; 303 case 6: 304 a.options.zoomWindowHeight > 305 a.nzHeight && (a.windowOffsetTop = a.nzHeight, a.windowOffsetLeft = -1 * (a.options.zoomWindowWidth / 2 - a.nzWidth / 2 + 2 * a.options.borderSize)); 306 break; 307 case 7: 308 a.windowOffsetTop = a.nzHeight; 309 a.windowOffsetLeft = 0; 310 break; 311 case 8: 312 a.windowOffsetTop = a.nzHeight; 313 a.windowOffsetLeft = -1 * (a.zoomWindow.width() + 2 * a.options.borderSize); 314 break; 315 case 9: 316 a.windowOffsetTop = a.nzHeight - a.zoomWindow.height() - 2 * a.options.borderSize; 317 a.windowOffsetLeft = -1 * (a.zoomWindow.width() + 2 * a.options.borderSize); 318 break; 319 case 10: 320 a.options.zoomWindowHeight > a.nzHeight && 321 (a.windowOffsetTop = -1 * (a.options.zoomWindowHeight / 2 - a.nzHeight / 2), a.windowOffsetLeft = -1 * (a.zoomWindow.width() + 2 * a.options.borderSize)); 322 break; 323 case 11: 324 a.windowOffsetTop = a.options.zoomWindowOffety; 325 a.windowOffsetLeft = -1 * (a.zoomWindow.width() + 2 * a.options.borderSize); 326 break; 327 case 12: 328 a.windowOffsetTop = -1 * (a.zoomWindow.height() + 2 * a.options.borderSize); 329 a.windowOffsetLeft = -1 * (a.zoomWindow.width() + 2 * a.options.borderSize); 330 break; 331 case 13: 332 a.windowOffsetTop = -1 * (a.zoomWindow.height() + 2 * a.options.borderSize); 333 a.windowOffsetLeft = 334 0; 335 break; 336 case 14: 337 a.options.zoomWindowHeight > a.nzHeight && (a.windowOffsetTop = -1 * (a.zoomWindow.height() + 2 * a.options.borderSize), a.windowOffsetLeft = -1 * (a.options.zoomWindowWidth / 2 - a.nzWidth / 2 + 2 * a.options.borderSize)); 338 break; 339 case 15: 340 a.windowOffsetTop = -1 * (a.zoomWindow.height() + 2 * a.options.borderSize); 341 a.windowOffsetLeft = a.nzWidth - a.zoomWindow.width() - 2 * a.options.borderSize; 342 break; 343 case 16: 344 a.windowOffsetTop = -1 * (a.zoomWindow.height() + 2 * a.options.borderSize); 345 a.windowOffsetLeft = a.nzWidth; 346 break; 347 default: 348 a.windowOffsetTop = 349 a.options.zoomWindowOffety, a.windowOffsetLeft = a.nzWidth 350 } 351 a.isWindowSet = !0; 352 a.windowOffsetTop += a.options.zoomWindowOffety; 353 a.windowOffsetLeft += a.options.zoomWindowOffetx; 354 a.zoomWindow.css({ 355 top: a.windowOffsetTop 356 }); 357 a.zoomWindow.css({ 358 left: a.windowOffsetLeft 359 }); 360 "inner" == a.options.zoomType && (a.zoomWindow.css({ 361 top: 0 362 }), a.zoomWindow.css({ 363 left: 0 364 })); 365 a.windowLeftPos = String(-1 * ((b.pageX - a.nzOffset.left) * a.widthRatio - a.zoomWindow.width() / 2)); 366 a.windowTopPos = String(-1 * ((b.pageY - a.nzOffset.top) * a.heightRatio - a.zoomWindow.height() / 367 2)); 368 a.Etoppos && (a.windowTopPos = 0); 369 a.Eloppos && (a.windowLeftPos = 0); 370 a.Eboppos && (a.windowTopPos = -1 * (a.largeHeight / a.currentZoomLevel - a.zoomWindow.height())); 371 a.Eroppos && (a.windowLeftPos = -1 * (a.largeWidth / a.currentZoomLevel - a.zoomWindow.width())); 372 a.fullheight && (a.windowTopPos = 0); 373 a.fullwidth && (a.windowLeftPos = 0); 374 if ("window" == a.options.zoomType || "inner" == a.options.zoomType) 1 == a.zoomLock && (1 >= a.widthRatio && (a.windowLeftPos = 0), 1 >= a.heightRatio && (a.windowTopPos = 0)), a.largeHeight < a.options.zoomWindowHeight && (a.windowTopPos = 375 0), a.largeWidth < a.options.zoomWindowWidth && (a.windowLeftPos = 0), a.options.easing ? (a.xp || (a.xp = 0), a.yp || (a.yp = 0), a.loop || (a.loop = setInterval(function() { 376 a.xp += (a.windowLeftPos - a.xp) / a.options.easingAmou
376nt; 377 a.yp += (a.windowTopPos - a.yp) / a.options.easingAmount; 378 a.scrollingLock ? (clearInterval(a.loop), a.xp = a.windowLeftPos, a.yp = a.windowTopPos, a.xp = -1 * ((b.pageX - a.nzOffset.left) * a.widthRatio - a.zoomWindow.width() / 2), a.yp = -1 * ((b.pageY - a.nzOffset.top) * a.heightRatio - a.zoomWindow.height() / 2), a.changeBgSize && (a.nzHeight > 379 a.nzWidth ? ("lens" == a.options.zoomType && a.zoomLens.css({ 380 "background-size": a.largeWidth / a.newvalueheight + "px " + a.largeHeight / a.newvalueheight + "px" 381 }), a.zoomWindow.css({ 382 "background-size": a.largeWidth / a.newvalueheight + "px " + a.largeHeight / a.newvalueheight + "px" 383 })) : ("lens" != a.options.zoomType && a.zoomLens.css({ 384 "background-size": a.largeWidth / a.newvaluewidth + "px " + a.largeHeight / a.newvalueheight + "px" 385 }), a.zoomWindow.css({ 386 "background-size": a.largeWidth / a.newvaluewidth + "px " + a.largeHeight / a.newvaluewidth + "px" 387 })), 388 a.changeBgSize = !1), a.zoomWindow.css({ 389 backgroundPosition: a.windowLeftPos + "px " + a.windowTopPos + "px" 390 }), a.scrollingLock = !1, a.loop = !1) : (a.changeBgSize && (a.nzHeight > a.nzWidth ? ("lens" == a.options.zoomType && a.zoomLens.css({ 391 "background-size": a.largeWidth / a.newvalueheight + "px " + a.largeHeight / a.newvalueheight + "px" 392 }), a.zoomWindow.css({ 393 "background-size": a.largeWidth / a.newvalueheight + "px " + a.largeHeight / a.newvalueheight + "px" 394 })) : ("lens" != a.options.zoomType && a.zoomLens.css({ 395 "background-size": a.largeWidth / a.newvaluewidth + 396 "px " + a.largeHeight / a.newvaluewidth + "px" 397 }), a.zoomWindow.css({ 398 "background-size": a.largeWidth / a.newvaluewidth + "px " + a.largeHeight / a.newvaluewidth + "px" 399 })), a.changeBgSize = !1), a.zoomWindow.css({ 400 backgroundPosition: a.xp + "px " + a.yp + "px" 401 })) 402 }, 16))) : (a.changeBgSize && (a.nzHeight > a.nzWidth ? ("lens" == a.options.zoomType && a.zoomLens.css({ 403 "background-size": a.largeWidth / a.newvalueheight + "px " + a.largeHeight / a.newvalueheight + "px" 404 }), a.zoomWindow.css({ 405 "background-size": a.largeWidth / a.newvalueheight + "px " + a.largeHeight / 406 a.newvalueheight + "px" 407 })) : ("lens" == a.options.zoomType && a.zoomLens.css({ 408 "background-size": a.largeWidth / a.newvaluewidth + "px " + a.largeHeight / a.newvaluewidth + "px" 409 }), a.largeHeight / a.newvaluewidth < a.options.zoomWindowHeight ? a.zoomWindow.css({ 410 "background-size": a.largeWidth / a.newvaluewidth + "px " + a.largeHeight / a.newvaluewidth + "px" 411 }) : a.zoomWindow.css({ 412 "background-size": a.largeWidth / a.newvalueheight + "px " + a.largeHeight / a.newvalueheight + "px" 413 })), a.changeBgSize = !1), a.zoomWindow.css({ 414 backgroundPosition: a.windowLeftPos + 415 "px " + a.windowTopPos + "px" 416 })) 417 }, 418 setTintPosition: function(b) { 419 this.nzOffset = this.$elem.offset(); 420 this.tintpos = String(-1 * (b.pageX - this.nzOffset.left - this.zoomLens.width() / 2)); 421 this.tintposy = String(-1 * (b.pageY - this.nzOffset.top - this.zoomLens.height() / 2)); 422 this.Etoppos && (this.tintposy = 0); 423 this.Eloppos && (this.tintpos = 0); 424 this.Eboppos && (this.tintposy = -1 * (this.nzHeight - this.zoomLens.height() - 2 * this.options.lensBorderSize)); 425 this.Eroppos && (this.tintpos = -1 * (this.nzWidth - this.zoomLens.width() - 2 * this.options.lensBorderSize)); 426 this.options.tint && (this.fullheight && (this.tintposy = 0), this.fullwidth && (this.tintpos = 0), this.zoomTintImage.css({ 427 left: this.tintpos + "px" 428 }), this.zoomTintImage.css({ 429 top: this.tintposy + "px" 430 })) 431 }, 432 swaptheimage: function(b, a) { 433 var c = this, 434 e = new Image; 435 c.options.loadingIcon && (c.spinner = d("<div style=\"background: url('" + c.options.loadingIcon + "') no-repeat center;height:" + c.nzHeight + "px;
435width:" + c.nzWidth + 'px;z-index: 2000;position: absolute; background-position: center center;"></div>'), c.$elem.after(c.spinner)); 436 c.options.onImageSwap(c.$elem); 437 e.onload = function() { 438 c.largeWidth = e.width; 439 c.largeHeight = e.height; 440 c.zoomImage = a; 441 c.zoomWindow.css({ 442 "background-size": c.largeWidth + "px " + c.largeHeight + "px" 443 }); 444 c.zoomWindow.css({ 445 "background-size": c.largeWidth + "px " + c.largeHeight + "px" 446 }); 447 c.swapAction(b, a) 448 }; 449 e.src = a 450 }, 451 swapAction: function(b, a) { 452 var c = this, 453 e = new Image; 454 e.onload = function() { 455 c.nzHeight = e.height; 456 c.nzWidth = e.width; 457 c.options.onImageSwapComplete(c.$elem); 458 c.doneCallback() 459 }; 460 e.src = b; 461 c.currentZoomLevel = c.options.zoomLevel; 462 c.options.maxZoomLevel = !1; 463 "lens" == c.options.zoomType && c.zoomLens.css({ 464 backgroundImage: "url('" + a + "')" 465 }); 466 "window" == c.options.zoomType && c.zoomWindow.css({ 467 backgroundImage: "url('" + a + "')" 468 }); 469 "inner" == c.options.zoomType && c.zoomWindow.css({ 470 backgroundImage: "url('" + a + "')" 471 }); 472 c.currentImage = a; 473 if (c.options.imageCrossfade) { 474 var f = c.$elem, 475 g = f.clone(); 476 c.$elem.attr("src", b); 477 c.$elem.after(g); 478 g.stop(!0).fadeOut(c.options.imageCrossfade, function() { 479 d(this).remove() 480 }); 481 c.$elem.width("auto").removeAttr("width"); 482 c.$elem.height("auto").removeAttr("height"); 483 f.fadeIn(c.options.imageCrossfade); 484 c.options.tint && "inner" != c.options.zoomType && (f = c.zoomTintImage, g = f.clone(), c.zoomTintImage.attr("src", a), c.zoomTintImage.after(g), g.stop(!0).fadeOut(c.options.imageCrossfade, function() { 485 d(this).remove() 486 }), f.fadeIn(c.options.imageCrossfade), c.zoomTint.css({ 487 height: c.$elem.height() 488 }), c.zoomTint.css({ 489 width: c.$elem.width() 490 })); 491 c.zoomContainer.css("height", c.$elem.height()); 492 c.zoomContainer.css("width", c.$elem.width()); 493 "inner" != c.options.zoomType || c.options.constrainType || 494 (c.zoomWrap.parent().css("height", c.$elem.height()), c.zoomWrap.parent().css("width", c.$elem.width()), c.zoomWindow.css("height", c.$elem.height()), c.zoomWindow.css("width", c.$elem.width())) 495 } else c.$elem.attr("src", b), c.options.tint && (c.zoomTintImage.attr("src", a), c.zoomTintImage.attr("height", c.$elem.height()), c.zoomTintImage.css({ 496 height: c.$elem.height() 497 }), c.zoomTint.css({ 498 height: c.$elem.height() 499 })), c.zoomContainer.css("height", c.$elem.height()), c.zoomContainer.css("width", c.$elem.width()); 500 c.options.imageCrossfade && 501 (c.zoomWrap.css("height", c.$elem.height()), c.zoomWrap.css("width", c.$elem.width())); 502 c.options.constrainType && ("height" == c.options.constrainType && (c.zoomContainer.css("height", c.options.constrainSize), c.zoomContainer.css("width", "auto"), c.options.imageCrossfade ? (c.zoomWrap.css("height", c.options.constrainSize), c.zoomWrap.css("width", "auto"), c.constwidth = c.zoomWrap.width()) : (c.$elem.css("height", c.options.constrainSize), c.$elem.css("width", "auto"), c.constwidth = c.$elem.width()), "inner" == c.options.zoomType && 503 (c.zoomWrap.parent().css("height", c.options.constrainSize), c.zoomWrap.parent().css("width", c.constwidth), c.zoomWindow.css("height", c.options.constrainSize), c.zoomWindow.css("width", c.constwidth)), c.options.tint && (c.tintContainer.css("height", c.options.constrainSize), c.tintContainer.css("width", c.constwidth), c.zoomTint.css("height", c.options.constrainSize), c.zoomTint.css("width", c.constwidth), c.zoomTintImage.css("height", c.options.constrainSize), c.zoomTintImage.css("width", c.constwidth))), "width" == 504 c.options.constrainType && (c.zoomContainer.css("height", "auto"), c.zoomContainer.css("width", c.options.constrainSize), c.options.imageCrossfade ? (c.zoomWrap.css("height", "auto"), c.zoomWrap.css("width", c.options.constrainSize), c.constheight = c.zoomWrap.height()) : (c.$elem.css("height", "auto"), c.$elem.css("width", c.options.constrainSize), c.constheight = c.$elem.height()), "inner" == c.options.zoomType && (c.zoomWrap.parent().css("height", c.constheight), c.zoomWrap.parent().css("width", c.options.constrainSize), c.zoomWindow.css("height", 505 c.constheight), c.zoomWindow.css("width", c.options.constrainSize)), c.options.tint && (c.tintContainer.css("height", c.constheight), c.tintContainer.css("width", c.options.constrainSize), c.zoomTint.css("height", c.constheight), c.zoomTint.css("width", c.options.constrainSize), c.zoomTintImage.css("height", c.constheight), c.zoomTintImage.css("width", c.options.constrainSize)))) 506 }, 507 doneCallback: function() { 508 this.options.loadingIcon && this.spinner.hide(); 509 this.nzOffset = this.$elem.offset(); 510 this.nzWidth = this.$elem.width(); 511 this.nzHeight = this.$elem.height(); 512 this.currentZoomLevel = this.options.zoomLevel; 513 this.widthRatio = this.largeWidth / this.nzWidth; 514 this.heightRatio = this.largeHeight / this.nzHeight; 515 "window" == this.options.zoomType && (lensHeight = this.nzHeight < this.options.zoomWindowWidth / this.widthRatio ? this.nzHeight :
515String(this.options.zoomWindowHeight / this.heightRatio), lensWidth = this.options.zoomWindowWidth < this.options.zoomWindowWidth ? this.nzWidth : this.options.zoomWindowWidth / this.widthRatio, this.zoomLens && (this.zoomLens.css("width", 516 lensWidth), this.zoomLens.css("height", lensHeight))) 517 }, 518 getCurrentImage: function() { 519 return this.zoomImage 520 }, 521 getGalleryList: function() { 522 var b = this; 523 b.gallerylist = []; 524 b.options.gallery ? d("#" + b.options.gallery + " a").each(function() { 525 var a = ""; 526 d(this).data("zoom-image") ? a = d(this).data("zoom-image") : d(this).data("image") && (a = d(this).data("image")); 527 a == b.zoomImage ? b.gallerylist.unshift({ 528 href: "" + a + "", 529 title: d(this).find("img").attr("title") 530 }) : b.gallerylist.push({ 531 href: "" + a + "", 532 title: d(this).find("img").attr("title") 533 }) 534 }) : 535 b.gallerylist.push({ 536 href: "" + b.zoomImage + "", 537 title: d(this).find("img").attr("title") 538 }); 539 return b.gallerylist 540 }, 541 changeZoomLevel: function(b) { 542 this.scrollingLock = !0; 543 this.newvalue = parseFloat(b).toFixed(2); 544 newvalue = parseFloat(b).toFixed(2); 545 maxheightnewvalue = this.largeHeight / (this.options.zoomWindowHeight / this.nzHeight * this.nzHeight); 546 maxwidthtnewvalue = this.largeWidth / (this.options.zoomWindowWidth / this.nzWidth * this.nzWidth); 547 "inner" != this.options.zoomType && (maxheightnewvalue <= newvalue ? (this.heightRatio = this.largeHeight / 548 maxheightnewvalue / this.nzHeight, this.newvalueheight = maxheightnewvalue, this.fullheight = !0) : (this.heightRatio = this.largeHeight / newvalue / this.nzHeight, this.newvalueheight = newvalue, this.fullheight = !1), maxwidthtnewvalue <= newvalue ? (this.widthRatio = this.largeWidth / maxwidthtnewvalue / this.nzWidth, this.newvaluewidth = maxwidthtnewvalue, this.fullwidth = !0) : (this.widthRatio = this.largeWidth / newvalue / this.nzWidth, this.newvaluewidth = newvalue, this.fullwidth = !1), "lens" == this.options.zoomType && (maxheightnewvalue <= newvalue ? 549 (this.fullwidth = !0, this.newvaluewidth = maxheightnewvalue) : (this.widthRatio = this.largeWidth / newvalue / this.nzWidth, this.newvaluewidth = newvalue, this.fullwidth = !1))); 550 "inner" == this.options.zoomType && (maxheightnewvalue = parseFloat(this.largeHeight / this.nzHeight).toFixed(2), maxwidthtnewvalue = parseFloat(this.largeWidth / this.nzWidth).toFixed(2), newvalue > maxheightnewvalue && (newvalue = maxheightnewvalue), newvalue > maxwidthtnewvalue && (newvalue = maxwidthtnewvalue), maxheightnewvalue <= newvalue ? (this.heightRatio = this.largeHeight / 551 newvalue / this.nzHeight, this.newvalueheight = newvalue > maxheightnewvalue ? maxheightnewvalue : newvalue, this.fullheight = !0) : (this.heightRatio = this.largeHeight / newvalue / this.nzHeight, this.newvalueheight = newvalue > maxheightnewvalue ? maxheightnewvalue : newvalue, this.fullheight = !1), maxwidthtnewvalue <= newvalue ? (this.widthRatio = this.largeWidth / newvalue / this.nzWidth, this.newvaluewidth = newvalue > maxwidthtnewvalue ? maxwidthtnewvalue : newvalue, this.fullwidth = !0) : (this.widthRatio = this.largeWidth / newvalue / this.nzWidth, this.newvaluewidth = 552 newvalue, this.fullwidth = !1)); 553 scrcontinue = !1; 554 "inner" == this.options.zoomType && (this.nzWidth > this.nzHeight && (this.newvaluewidth <= maxwidthtnewvalue ? scrcontinue = !0 : (scrcontinue = !1, this.fullwidth = this.fullheight = !0)), this.nzHeight > this.nzWidth && (this.newvaluewidth <= maxwidthtnewvalue ? scrcontinue = !0 : (scrcontinue = !1, this.fullwidth = this.fullheight = !0))); 555 "inner" != this.options.zoomType && (scrcontinue = !0); 556 scrcontinue && (this.zoomLock = 0, this.changeZoom = !0, this.options.zoomWindowHeight / this.heightRatio <= this.nzHeight && 557 (this.currentZoomLevel = this.newvalueheight, "lens" != this.options.zoomType && "inner" != this.options.zoomType && (this.changeBgSize = !0, this.zoomLens.css({ 558 height: String(this.options.zoomWindowHeight / this.heightRatio) + "px" 559 })), "lens" == this.options.zoomType || "inner" == this.options.zoomType) && (this.changeBgSize = !0), this.options.zoomWindowWidth / this.widthRatio <= this.nzWidth && ("inner" != this.options.zoomType && this.newvaluewidth > this.newvalueheight && (this.currentZoomLevel = this.newvaluewidth), "lens" != this.options.zoomType && 560 "inner" != this.options.zoomType && (this.changeBgSize = !0, this.zoomLens.css({ 561 width: String(this.options.zoomWindowWidth / this.widthRatio) + "px" 562 })), "lens" == this.options.zoomType || "inner" == this.options.zoomType) && (this.changeBgSize = !0), "inner" == this.options.zoomType && (this.changeBgSize = !0, this.nzWidth > this.nzHeight && (this.currentZoomLevel = this.newvaluewidth), this.nzHeight > this.nzWidth && (this.currentZoomLevel = this.newvaluewidth))); 563 this.setPosition(this.currentLoc) 564 }, 565 closeAll: function() { 566 self.zoomWindow && self.zoomWindow.hide(); 567 self.zoomLens && self.zoomLens.hide(); 568 self.zoomTint && self.zoomTint.hide() 569 }, 570 changeState: function(b) { 571 "enable" == b && (this.options.zoomEnabled = !0); 572 "disable" == b && (this.options.zoomEnabled = !1) 573 } 574 }; 575 d.fn.elevateZoom = function(b) { 576 return this.each(function() { 577 var a = Object.create(k); 578 a.init(b, this); 579 d.data(this, "elevateZoom", a) 580 }) 581 }; 582 d.fn.elevateZoom.options = { 583 zoomActivation: "hover", 584 zoomEnabled: !0, 585 preloading: 1, 586 zoomLevel: 1, 587 scrollZoom: !1, 588 scrollZoomIncrement: 0.1, 589 minZoomLevel: !1, 590 maxZoomLevel: !1, 591 easing: !1,
592 easingAmount: 12, 593 lensSize: 200, 594 zoomWindowWidth: 400, 595 zoomWindowHeight: 400, 596 zoomWindowOffetx: 0, 597 zoomWindowOffety: 0, 598 zoomWindowPosition: 1, 599 zoomWindowBgColour: "#fff", 600 lensFadeIn: !1, 601 lensFadeOut: !1, 602 debug: !1, 603 zoomWindowFadeIn: !1, 604 zoomWindowFadeOut: !1, 605 zoomWindowAlwaysShow: !1, 606 zoomTintFadeIn: !1, 607 zoomTintFadeOut: !1, 608 borderSize: 4, 609 showLens: !0, 610 borderColour: "#888", 611 lensBorderSize: 1, 612 lensBorderColour: "#000", 613 lensShape: "square", 614 zoomType: "window", 615 containLensZoom: !1, 616 lensColour: "white", 617 lensOpacity: 0.4, 618 lenszoom: !1, 619 tint: !1, 620 tintColour: "#333", 621 tintOpacity: 0.4, 622 gallery: !1, 623 galleryActiveClass: "zoomGalleryActive", 624 imageCrossfade: !1, 625 constrainType: !1, 626 constrainSize: !1, 627 loadingIcon: !1, 628 cursor: "default", 629 responsive: !0, 630 onComplete: d.noop, 631 onZoomedImageLoaded: function() {}, 632 onImageSwap: d.noop, 633 onImageSwapComplete: d.noop 634 } 635})(jQuery, window, document);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.