Thursday, 4 June 2020
ELEVATE ZOOM JAVA SCRIPT WITH ONE IMAGE
---------------------------------------------------------------------------------------------------------------------
ELEVATE ZOOM JAVA SCRIPT
NEED TWO JAVA FILE
1) JQUERY MIN VERSION 1.8.3
2)ELEVATE ZOOM MIN JS FILE
3) BETWEEN HEAD TAG CODE FOR ZOOM STYLE LIKE
https://community.shopify.com/c/Shopify-Discussion/variant-images-and-their-thumbnails/td-p/207701
https://bonpresta.com/
https://module-presta.com/digitalbox-prestashop-1-6-theme.html
https://www.prestashop.com/forums/topic/955354-free-best-zoom-magnifier-effect-bazoom-magnifier/
https://buy-addons.com/store/prestashop/best-zoom-magnifier-effect-bazoom-magnifier.html#utm_source=prestashop_zoom-magnifier-effect_post&utm_medium=prestashop_zoom-magnifier-effect_post&utm_campaign=prestashop_forum
https://prestashop-demo.com/1000demo/frontend.php
https://prestashop-demo.com/1000demo/prestashop_16/blouses/2-blouse.html
http://livedemo00.template-help.com/free_prestashop_1_6_template/index.php?id_product=2&controller=product&id_lang=1
https://www.chiphost.org/blog/prestashop-ecommerce-themes/
SHOPIFY ELEVATE ZOOM
https://theme232-handbags.myshopify.com/products/alexander_mcqueen_mini_heroine?variant=14889902407
https://www.themelock.com/ecommerce/687015779-bigsale-v100-the-clean-minimal-unlimited-bootstrap-4-shopify-theme-12-homepages.html
----------------------------------------------------------------------------------------------------------------------
HOW TO ZOOM WINDOW IMAGE BACKGROUND FIXED AND
ZOOM LENS SIZE FIX
----------------------------------------------------------------------------------------------------------------------
π Ώππ ΄πππ ° π ΄π »π ΄π π °ππ ΄ππ Ύπ Ύπ Ό π ²π Έππ ²π »π ΄ π »π ΄π ½π π ΄π ΅π ΅π ΄π ²π
if (typeof Object.create !== "function") { Object.create = function(e) { function t() {} t.prototype = e; return new t } }(function(e, t, n, r) { var i = { init: function(t, n) { var r = this; r.elem = n; r.$elem = e(n); r.imageSrc = r.$elem.data("zoom-image") ? r.$elem.data("zoom-image") : r.$elem.attr("src"); r.options = e.extend({}, e.fn.elevateZoom.options, t); if (r.options.zoomImage != "") r.imageSrc = r.options.zoomImage; if (r.options.tint) { r.options.lensColour = "none", r.options.lensOpacity = "1" } if (r.options.zoomType == "inner") { r.options.showLens = false; r.options.tint = false } if (r.options.zoomType == "lens") { r.options.tint = false } r.$elem.parent().removeAttr("title").removeAttr("alt"); r.zoomImage = r.imageSrc; r.refresh(1); e("#" + r.options.gallery + " a").click(function(t) { if (r.options.galleryActiveClass) { e("#" + r.options.gallery + " a").removeClass(r.options.galleryActiveClass); e(this).addClass(r.options.galleryActiveClass) } t.preventDefault(); if (e(this).data("zoom-image")) { r.zoomImagePre = e(this).data("image") } else { r.zoomImagePre = e(this).data("zoom-image") } r.swaptheimage(e(this).data("image"), r.zoomImagePre); return false }) }, refresh: function(e) { var t = this; setTimeout(function() { t.fetch(t.imageSrc) }, e || t.options.refresh) }, fetch: function(e) { var t = this; var n = new Image; n.onload = function() { t.largeWidth = n.width; t.largeHeight = n.height; t.startZoom(); t.currentImage = t.imageSrc; t.options.onZoomedImageLoaded(t.$elem) }; n.src = e; return }, startZoom: function() { var t = this; t.nzWidth = t.$elem.width(); t.nzHeight = t.$elem.height(); t.isWindowActive = false; t.isLensActive = false; t.isTintActive = false; t.overWindow = false; if (t.options.imageCrossfade) { t.zoomWrap = t.$elem.wrap('<div style="height:' + t.nzHeight + "px;width:" + t.nzWidth + 'px;" class="zoomWrapper" />'); t.$elem.css("position", "absolute") } t.zoomLock = 1; t.scrollingLock = false; t.changeBgSize = false; t.currentZoomLevel = t.options.zoomLevel; t.nzOffset = t.$elem.offset(); t.widthRatio = t.largeWidth / t.currentZoomLevel / t.nzWidth; t.heightRatio = t.largeHeight / t.currentZoomLevel / t.nzHeight; if (t.options.zoomType == "window") { t.zoomWindowStyle = "overflow: hidden;" + "background-position: 0px 0px;text-align:center;" + "background-color: " + String(t.options.zoomWindowBgColour) + ";width: " + String(t.options.zoomWindowWidth) + "px;" + "height: " + String(t.options.zoomWindowHeight) + "px;float: left;" + "background-size: " + t.largeWidth / t.currentZoomLevel + "px " + t.largeHeight / t.currentZoomLevel + "px;" + "display: none;z-index:100;" + "border: " + String(t.options.borderSize) + "px solid " + t.options.borderColour + ";background-repeat: no-repeat;" + "position: absolute;" } if (t.options.zoomType == "inner") { var n = t.$elem.css("border-left-width"); t.zoomWindowStyle = "overflow: hidden;" + "margin-left: " + String(n) + ";" + "margin-top: " + String(n) + ";" + "background-position: 0px 0px;" + "width: " + String(t.nzWidth) + "px;" + "height: " + String(t.nzHeight) + "px;float: left;" + "display: none;" + "cursor:" + t.options.cursor + ";" + "background-size: " + t.largeWidth / t.currentZoomLevel + "px " + t.largeHeight / t.currentZoomLevel + "px;" + "px solid " + t.options.borderColour + ";background-repeat: no-repeat;" + "position: absolute;" } if (t.options.zoomType == "window") { if (t.nzHeight < t.options.zoomWindowWidth / t.widthRatio) { lensHeight = t.nzHeight } else { lensHeight = String(t.options.zoomWindowHeight / t.heightRatio) } if (t.largeWidth < t.options.zoomWindowWidth) { lensWidth = t.nzWidth } else { lensWidth = t.options.zoomWindowWidth / t.widthRatio } t.lensStyle = "background-position: 0px 0px;width: " + String(t.options.zoomWindowWidth / t.widthRatio) + "px;height: " + String(t.options.zoomWindowHeight / t.heightRatio) + "px;float: right;display: none;" + "overflow: hidden;" + "z-index: 999;" + "opacity:" + t.options.lensOpacity + ";filter: alpha(opacity = " + t.options.lensOpacity * 100 + "); zoom:1;" + "width:" + lensWidth + "px;" + "height:" + lensHeight + "px;" + "background-color:" + t.options.lensColour + ";" + "cursor:" + t.options.cursor + ";" + "border: " + t.options.lensBorderSize + "px" + " solid " + t.options.lensBorderColour + ";background-repeat: no-repeat;position: absolute;" } t.tintStyle = "display: block;" + "position: absolute;" + "z-index: 990;" + "background-color: " + t.options.tintColour + ";" + "filter:alpha(opacity=0);" + "opacity: 0;" + "width: " + t.nzWidth + "px;" + "height: " + t.nzHeight + "px;"; t.lensRound = ""; if (t.options.zoomType == "lens") { t.lensStyle = "background-position: 0px 0px;" + "z-index: 999;" + "float: left;display: none;" + "border: " + String(t.options.borderSize) + "px solid " + t.options.borderColour + ";" + "width:" + String(t.options.lensSize) + "px;" + "height:" + String(t.options.lensSize) + "px;" + "background-size: " + t.largeWidth / t.currentZoomLevel + "px " + t.largeHeight / t.currentZoomLevel + "px;" + "background-repeat: no-repeat;position: absolute;" } if (t.options.lensShape == "round") { t.lensRound = "border-top-left-radius: " + String(t.options.lensSize / 2 + t.options.borderSize) + "px;" + "border-top-right-radius: " + String(t.options.lensSize / 2 + t.options.borderSize) + "px;" + "border-bottom-left-radius: " + String(t.options.lensSize / 2 + t.options.borderSize) + "px;" + "border-bottom-right-radius: " + String(t.options.lensSize / 2 + t.options.borderSize) + "px;" } t.zoomContainer = e('<div class="zoomContainer" style="position:absolute;left:' + t.nzOffset.left + "px;top:" + t.nzOffset.top + "px;height:" + t.nzHeight + "px;width:" + t.nzWidth + 'px;"></div>'); e("body").append(t.zoomContainer); if (t.options.containLensZoom && t.options.zoomType == "lens") { t.zoomContainer.css("overflow", "hidden") } if (t.options.zoomType != "inner") { t.zoomLens = e("<div class='zoomLens' style='" + t.lensStyle + t.lensRound + "'> </div>").appendTo(t.zoomContainer).click(function() { t.$elem.trigger("click") }); if (t.options.tint && t.options.zoomType != "inner") { t.tintContainer = e("<div/>").addClass("tintContainer"); t.zoomTint = e("<div class='zoomTint' style='" + t.tintStyle + "'></div>"); t.zoomLens.wrap(t.tintContainer); t.zoomTintcss = t.zoomLens.after(t.zoomTint); t.zoomTintImage = e('<img style="position: absolute; left: 0px; top: 0px; max-width: none; width: ' + t.nzWidth + "px; height: " + t.nzHeight + 'px;" src="' + t.$elem.attr("src") + '">').appendTo(t.zoomLens).click(function() { t.$elem.trigger("click") }) } } if (isNaN(t.options.zoomWindowPosition)) { t.zoomWindow = e("<div style='z-index:999;left:" + t.windowOffsetLeft + "px;top:" + t.windowOffsetTop + "px;" + t.zoomWindowStyle + "' class='zoomWindow'> </div>").appendTo("body").click(function() { t.$elem.trigger("click") }) } else { t.zoomWindow = e("<div style='z-index:999;left:" + t.windowOffsetLeft + "px;top:" + t.windowOffsetTop + "px;" + t.zoomWindowStyle + "' class='zoomWindow'> </div>").appendTo(t.zoomContainer).click(function() { t.$elem.trigger("click") }) } t.zoomWindowContainer = e("<div/>").addClass("zoomWindowContainer").css("width", t.options.zoomWindowWidth); t.zoomWindow.wrap(t.zoomWindowContainer); if (t.options.zoomType == "lens") { t.zoomLens.css({ backgroundImage: "url('" + t.imageSrc + "')" }) } if (t.options.zoomType == "window") { t.zoomWindow.css({ backgroundImage: "url('" + t.imageSrc + "')" }) } if (t.options.zoomType == "inner") { t.zoomWindow.css({ backgroundImage: "url('" + t.imageSrc + "')" }) } t.$elem.bind("touchmove", function(e) { e.preventDefault(); var n = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; t.setPosition(n) }); t.zoomContainer.bind("touchmove", function(e) { if (t.options.zoomType == "inner") { t.showHideWindow("show") } e.preventDefault(); var n = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; t.setPosition(n) }); t.zoomContainer.bind("touchend", function(e) { t.showHideWindow("hide"); if (t.options.showLens) { t.showHideLens("hide") } if (t.options.tint && t.options.zoomType != "inner") { t.showHideTint("hide") } }); t.$elem.bind("touchend", function(e) { t.showHideWindow("hide"); if (t.options.showLens) { t.showHideLens("hide") } if (t.options.tint && t.options.zoomType != "inner") { t.showHideTint("hide") } }); if (t.options.showLens) { t.zoomLens.bind("touchmove", function(e) { e.preventDefault(); var n = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; t.setPosition(n) }); t.zoomLens.bind("touchend", function(e) { t.showHideWindow("hide"); if (t.options.showLens) { t.showHideLens("hide") } if (t.options.tint && t.options.zoomType != "inner") { t.showHideTint("hide") } }) } t.$elem.bind("mousemove", function(e) { if (t.overWindow == false) { t.setElements("show") } if (t.lastX !== e.clientX || t.lastY !== e.clientY) { t.setPosition(e); t.currentLoc = e } t.lastX = e.clientX; t.lastY = e.clientY }); t.zoomContainer.bind("mousemove", function(e) { if (t.overWindow == false) { t.setElements("show") } if (t.lastX !== e.clientX || t.lastY !== e.clientY) { t.setPosition(e); t.currentLoc = e } t.lastX = e.clientX; t.lastY = e.clientY }); if (t.options.zoomType != "inner") { t.zoomLens.bind("mousemove", function(e) { if (t.lastX !== e.clientX || t.lastY !== e.clientY) { t.setPosition(e); t.currentLoc = e } t.lastX = e.clientX; t.lastY = e.clientY }) } if (t.options.tint && t.options.zoomType != "inner") { t.zoomTint.bind("mousemove", function(e) { if (t.lastX !== e.clientX || t.lastY !== e.clientY) { t.setPosition(e); t.currentLoc = e } t.lastX = e.clientX; t.lastY = e.clientY }) } if (t.options.zoomType == "inner") { t.zoomWindow.bind("mousemove", function(e) { if (t.lastX !== e.clientX || t.lastY !== e.clientY) { t.setPosition(e); t.currentLoc = e } t.lastX = e.clientX; t.lastY = e.clientY }) } t.zoomContainer.add(t.$elem).mouseenter(function() { if (t.overWindow == false) { t.setElements("show") } }).mouseleave(function() { if (!t.scrollLock) { t.setElements("hide") } }); if (t.options.zoomType != "inner") { t.zoomWindow.mouseenter(function() { t.overWindow = true; t.setElements("hide") }).mouseleave(function() { t.overWindow = false }) } if (t.options.zoomLevel != 1) {} if (t.options.minZoomLevel) { t.minZoomLevel = t.options.minZoomLevel } else { t.minZoomLevel = t.options.scrollZoomIncrement * 2 } if (t.options.scrollZoom) { t.zoomContainer.add(t.$elem).bind("mousewheel DOMMouseScroll MozMousePixelScroll", function(n) { t.scrollLock = true; clearTimeout(e.data(this, "timer")); e.data(this, "timer", setTimeout(function() { t.scrollLock = false }, 250)); var r = n.originalEvent.wheelDelta || n.originalEvent.detail * -1; n.stopImmediatePropagation(); n.stopPropagation(); n.preventDefault(); if (t.options.zoomType != "inner") { if (r / 120 > 0) { if (t.currentZoomLevel >= t.minZoomLevel) { t.changeZoomLevel(t.currentZoomLevel - t.options.scrollZoomIncrement) } } else { if (t.options.maxZoomLevel) { if (t.currentZoomLevel <= t.options.maxZoomLevel) { t.changeZoomLevel(parseFloat(t.currentZoomLevel) + t.options.scrollZoomIncrement) } } else { t.changeZoomLevel(parseFloat(t.currentZoomLevel) + t.options.scrollZoomIncrement) } } } return false }) } }, setElements: function(e) { var t = this; if (!t.options.zoomEnabled) { return false } if (e == "show") { if (t.isWindowSet) { if (t.options.zoomType == "inner") { t.showHideWindow("show") } if (t.options.zoomType == "window") { t.showHideWindow("show") } if (t.options.showLens) { t.showHideLens("show") } if (t.options.tint && t.options.zoomType != "inner") { t.showHideTint("show") } } } if (e == "hide") { if (t.options.zoomType == "window") { t.showHideWindow("hide") } if (!t.options.tint) { t.showHideWindow("hide") } if (t.options.showLens) { t.showHideLens("hide") } if (t.options.tint) { t.showHideTint("hide") } } }, setPosition: function(e) { var t = this; if (!t.options.zoomEnabled) { return false } t.nzHeight = t.$elem.height(); t.nzWidth = t.$elem.width(); t.nzOffset = t.$elem.offset(); if (t.options.tint && t.options.zoomType != "inner") { t.zoomTint.css({ top: 0 }); t.zoomTint.css({ left: 0 }) } if (t.options.responsive && !t.options.scrollZoom) { if (t.options.showLens) { if (t.nzHeight < t.options.zoomWindowWidth / t.widthRatio) { lensHeight = t.nzHeight } else { lensHeight = String(t.options.zoomWindowHeight / t.heightRatio) } if (t.largeWidth < t.options.zoomWindowWidth) { lensWidth = t.nzWidth } else { lensWidth = t.options.zoomWindowWidth / t.widthRatio } t.widthRatio = t.largeWidth / t.nzWidth; t.heightRatio = t.largeHeight / t.nzHeight; if (t.options.zoomType != "lens") { if (t.nzHeight < t.options.zoomWindowWidth / t.widthRatio) { lensHeight = t.nzHeight } else { lensHeight = String(t.options.zoomWindowHeight / t.heightRatio) } if (t.options.zoomWindowWidth < t.options.zoomWindowWidth) { lensWidth = t.nzWidth } else { lensWidth = t.options.zoomWindowWidth / t.widthRatio } t.zoomLens.css("width", lensWidth); t.zoomLens.css("height", lensHeight); if (t.options.tint && t.options.zoomType != "inner") { t.zoomTintImage.css("width", t.nzWidth); t.zoomTintImage.css("height", t.nzHeight) } } if (t.options.zoomType == "lens") { t.zoomLens.css({ width: String(t.options.lensSize) + "px", height: String(t.options.lensSize) + "px" }) } } } t.zoomContainer.css({ top: t.nzOffset.top }); t.zoomContainer.css({ left: t.nzOffset.left }); t.mouseLeft = parseInt(e.pageX - t.nzOffset.left); t.mouseTop = parseInt(e.pageY - t.nzOffset.top); if (t.options.zoomType == "window") { t.Etoppos = t.mouseTop < t.zoomLens.height() / 2; t.Eboppos = t.mouseTop > t.nzHeight - t.zoomLens.height() / 2 - t.options.lensBorderSize * 2; t.Eloppos = t.mouseLeft < 0 + t.zoomLens.width() / 2; t.Eroppos = t.mouseLeft > t.nzWidth - t.zoomLens.width() / 2 - t.options.lensBorderSize * 2 } if (t.options.zoomType == "inner") { t.Etoppos = t.mouseTop < t.nzHeight / 2 / t.heightRatio; t.Eboppos = t.mouseTop > t.nzHeight - t.nzHeight / 2 / t.heightRatio; t.Eloppos = t.mouseLeft < 0 + t.nzWidth / 2 / t.widthRatio; t.Eroppos = t.mouseLeft > t.nzWidth - t.nzWidth / 2 / t.widthRatio - t.options.lensBorderSize * 2 } if (t.mouseLeft <= 0 || t.mouseTop < 0 || t.mouseLeft > t.nzWidth || t.mouseTop > t.nzHeight) { t.setElements("hide"); return } else { if (t.options.showLens) { t.lensLeftPos = String(t.mouseLeft - t.zoomLens.width() / 2); t.lensTopPos = String(t.mouseTop - t.zoomLens.height() / 2) } if (t.Etoppos) { t.lensTopPos = 0 } if (t.Eloppos) { t.windowLeftPos = 0; t.lensLeftPos = 0; t.tintpos = 0 } if (t.options.zoomType == "window") { if (t.Eboppos) { t.lensTopPos = Math.max(t.nzHeight - t.zoomLens.height() - t.options.lensBorderSize * 2, 0) } if (t.Eroppos) { t.lensLeftPos = t.nzWidth - t.zoomLens.width() - t.options.lensBorderSize * 2 } } if (t.options.zoomType == "inner") { if (t.Eboppos) { t.lensTopPos = Math.max(t.nzHeight - t.options.lensBorderSize * 2, 0) } if (t.Eroppos) { t.lensLeftPos = t.nzWidth - t.nzWidth - t.options.lensBorderSize * 2 } } if (t.options.zoomType == "lens") { t.windowLeftPos = String(((e.pageX - t.nzOffset.left) * t.widthRatio - t.zoomLens.width() / 2) * -1); t.windowTopPos = String(((e.pageY - t.nzOffset.top) * t.heightRatio - t.zoomLens.height() / 2) * -1); t.zoomLens.css({ backgroundPosition: t.windowLeftPos + "px " + t.windowTopPos + "px" }); if (t.changeBgSize) { if (t.nzHeight > t.nzWidth) { if (t.options.zoomType == "lens") { t.zoomLens.css({ "background-size": t.largeWidth / t.newvalueheight + "px " + t.largeHeight / t.newvalueheight + "px" }) } t.zoomWindow.css({ "background-size": t.largeWidth / t.newvalueheight + "px " + t.largeHeight / t.newvalueheight + "px" }) } else { if (t.options.zoomType == "lens") { t.zoomLens.css({ "background-size": t.largeWidth / t.newvaluewidth + "px " + t.largeHeight / t.newvaluewidth + "px" }) } t.zoomWindow.css({ "background-size": t.largeWidth / t.newvaluewidth + "px " + t.largeHeight / t.newvaluewidth + "px" }) } t.changeBgSize = false } t.setWindowPostition(e) } if (t.options.tint && t.options.zoomType != "inner") { t.setTintPosition(e) } if (t.options.zoomType == "window") { t.setWindowPostition(e) } if (t.options.zoomType == "inner") { t.setWindowPostition(e) } if (t.options.showLens) { if (t.fullwidth && t.options.zoomType != "lens") { t.lensLeftPos = 0 } t.zoomLens.css({ left: t.lensLeftPos + "px", top: t.lensTopPos + "px" }) } } }, showHideWindow: function(e) { var t = this; if (e == "show") { if (!t.isWindowActive) { if (t.options.zoomWindowFadeIn) { t.zoomWindow.stop(true, true, false).fadeIn(t.options.zoomWindowFadeIn) } else { t.zoomWindow.show() } t.isWindowActive = true } } if (e == "hide") { if (t.isWindowActive) { if (t.options.zoomWindowFadeOut) { t.zoomWindow.stop(true, true).fadeOut(t.options.zoomWindowFadeOut) } else { t.zoomWindow.hide() } t.isWindowActive = false } } }, showHideLens: function(e) { var t = this; if (e == "show") { if (!t.isLensActive) { if (t.options.lensFadeIn) { t.zoomLens.stop(true, true, false).fadeIn(t.options.lensFadeIn) } else { t.zoomLens.show() } t.isLensActive = true } } if (e == "hide") { if (t.isLensActive) { if (t.options.lensFadeOut) { t.zoomLens.stop(true, true).fadeOut(t.options.lensFadeOut) } else { t.zoomLens.hide() } t.isLensActive = false } } }, showHideTint: function(e) { var t = this; if (e == "show") { if (!t.isTintActive) { if (t.options.zoomTintFadeIn) { t.zoomTint.css({ opacity: t.options.tintOpacity }).animate().stop(true, true).fadeIn("slow") } else { t.zoomTint.css({ opacity: t.options.tintOpacity }).animate(); t.zoomTint.show() } t.isTintActive = true } } if (e == "hide") { if (t.isTintActive) { if (t.options.zoomTintFadeOut) { t.zoomTint.stop(true, true).fadeOut(t.options.zoomTintFadeOut) } else { t.zoomTint.hide() } t.isTintActive = false } } }, setLensPostition: function(e) {}, setWindowPostition: function(t) { var n = this; if (!isNaN(n.options.zoomWindowPosition)) { switch (n.options.zoomWindowPosition) { case 1: n.windowOffsetTop = n.options.zoomWindowOffety; n.windowOffsetLeft = +n.nzWidth; break; case 2: if (n.options.zoomWindowHeight > n.nzHeight) { n.windowOffsetTop = (n.options.zoomWindowHeight / 2 - n.nzHeight / 2) * -1; n.windowOffsetLeft = n.nzWidth } else {} break; case 3: n.windowOffsetTop = n.nzHeight - n.zoomWindow.height() - n.options.borderSize * 2; n.windowOffsetLeft = n.nzWidth; break; case 4: n.windowOffsetTop = n.nzHeight; n.windowOffsetLeft = n.nzWidth; break; case 5: n.windowOffsetTop = n.nzHeight; n.windowOffsetLeft = n.nzWidth - n.zoomWindow.width() - n.options.borderSize * 2; break; case 6: if (n.options.zoomWindowHeight > n.nzHeight) { n.windowOffsetTop = n.nzHeight; n.windowOffsetLeft = (n.options.zoomWindowWidth / 2 - n.nzWidth / 2 + n.options.borderSize * 2) * -1 } else {} break; case 7: n.windowOffsetTop = n.nzHeight; n.windowOffsetLeft = 0; break; case 8: n.windowOffsetTop = n.nzHeight; n.windowOffsetLeft = (n.zoomWindow.width() + n.options.borderSize * 2) * -1; break; case 9: n.windowOffsetTop = n.nzHeight - n.zoomWindow.height() - n.options.borderSize * 2; n.windowOffsetLeft = (n.zoomWindow.width() + n.options.borderSize * 2) * -1; break; case 10: if (n.options.zoomWindowHeight > n.nzHeight) { n.windowOffsetTop = (n.options.zoomWindowHeight / 2 - n.nzHeight / 2) * -1; n.windowOffsetLeft = (n.zoomWindow.width() + n.options.borderSize * 2) * -1 } else {} break; case 11: n.windowOffsetTop = n.options.zoomWindowOffety; n.windowOffsetLeft = (n.zoomWindow.width() + n.options.borderSize * 2) * -1; break; case 12: n.windowOffsetTop = (n.zoomWindow.height() + n.options.borderSize * 2) * -1; n.windowOffsetLeft = (n.zoomWindow.width() + n.options.borderSize * 2) * -1; break; case 13: n.windowOffsetTop = (n.zoomWindow.height() + n.options.borderSize * 2) * -1; n.windowOffsetLeft = 0; break; case 14: if (n.options.zoomWindowHeight > n.nzHeight) { n.windowOffsetTop = (n.zoomWindow.height() + n.options.borderSize * 2) * -1; n.windowOffsetLeft = (n.options.zoomWindowWidth / 2 - n.nzWidth / 2 + n.options.borderSize * 2) * -1 } else {} break; case 15: n.windowOffsetTop = (n.zoomWindow.height() + n.options.borderSize * 2) * -1; n.windowOffsetLeft = n.nzWidth - n.zoomWindow.width() - n.options.borderSize * 2; break; case 16: n.windowOffsetTop = (n.zoomWindow.height() + n.options.borderSize * 2) * -1; n.windowOffsetLeft = n.nzWidth; break; default: n.windowOffsetTop = n.options.zoomWindowOffety; n.windowOffsetLeft = n.nzWidth } } else { n.externalContainer = e("#" + n.options.zoomWindowPosition); n.externalContainerWidth = n.externalContainer.width(); n.externalContainerHeight = n.externalContainer.height(); n.externalContainerOffset = n.externalContainer.offset(); n.windowOffsetTop = n.externalContainerOffset.top; n.windowOffsetLeft = n.externalContainerOffset.left } n.isWindowSet = true; n.windowOffsetTop = n.windowOffsetTop + n.options.zoomWindowOffety; n.windowOffsetLeft = n.windowOffsetLeft + n.options.zoomWindowOffetx; n.zoomWindow.css({ top: n.windowOffsetTop }); n.zoomWindow.css({ left: n.windowOffsetLeft }); if (n.options.zoomType == "inner") { n.zoomWindow.css({ top: 0 }); n.zoomWindow.css({ left: 0 }) } n.windowLeftPos = String(((t.pageX - n.nzOffset.left) * n.widthRatio - n.zoomWindow.width() / 2) * -1); n.windowTopPos = String(((t.pageY - n.nzOffset.top) * n.heightRatio - n.zoomWindow.height() / 2) * -1); if (n.Etoppos) { n.windowTopPos = 0 } if (n.Eloppos) { n.windowLeftPos = 0 } if (n.Eboppos) { n.windowTopPos = (n.largeHeight / n.currentZoomLevel - n.zoomWindow.height()) * -1 } if (n.Eroppos) { n.windowLeftPos = (n.largeWidth / n.currentZoomLevel - n.zoomWindow.width()) * -1 } if (n.fullheight) { n.windowTopPos = 0 } if (n.fullwidth) { n.windowLeftPos = 0 } if (n.options.zoomType == "window" || n.options.zoomType == "inner") { if (n.zoomLock == 1) { if (n.widthRatio <= 1) { n.windowLeftPos = 0 } if (n.heightRatio <= 1) { n.windowTopPos = 0 } } if (n.largeHeight < n.options.zoomWindowHeight) { n.windowTopPos = 0 } if (n.largeWidth < n.options.zoomWindowWidth) { n.windowLeftPos = 0 } if (n.options.easing) { if (!n.xp) { n.xp = 0 } if (!n.yp) { n.yp = 0 } if (!n.loop) { n.loop = setInterval(function() { n.xp += (n.windowLeftPos - n.xp) / n.options.easingAmount; n.yp += (n.windowTopPos - n.yp) / n.options.easingAmount; if (n.scrollingLock) { clearInterval(n.loop); n.xp = n.windowLeftPos; n.yp = n.windowTopPos; n.xp = ((t.pageX - n.nzOffset.left) * n.widthRatio - n.zoomWindow.width() / 2) * -1; n.yp = ((t.pageY - n.nzOffset.top) * n.heightRatio - n.zoomWindow.height() / 2) * -1; if (n.changeBgSize) { if (n.nzHeight > n.nzWidth) { if (n.options.zoomType == "lens") { n.zoomLens.css({ "background-size": n.largeWidth / n.newvalueheight + "px " + n.largeHeight / n.newvalueheight + "px" }) } n.zoomWindow.css({ "background-size": n.largeWidth / n.newvalueheight + "px " + n.largeHeight / n.newvalueheight + "px" }) } else { if (n.options.zoomType != "lens") { n.zoomLens.css({ "background-size": n.largeWidth / n.newvaluewidth + "px " + n.largeHeight / n.newvalueheight + "px" }) } n.zoomWindow.css({ "background-size": n.largeWidth / n.newvaluewidth + "px " + n.largeHeight / n.newvaluewidth + "px" }) } n.changeBgSize = false } n.zoomWindow.css({ backgroundPosition: n.windowLeftPos + "px " + n.windowTopPos + "px" }); n.scrollingLock = false; n.loop = false } else { if (n.changeBgSize) { if (n.nzHeight > n.nzWidth) { if (n.options.zoomType == "lens") { n.zoomLens.css({ "background-size": n.largeWidth / n.newvalueheight + "px " + n.largeHeight / n.newvalueheight + "px" }) } n.zoomWindow.css({ "background-size": n.largeWidth / n.newvalueheight + "px " + n.largeHeight / n.newvalueheight + "px" }) } else { if (n.options.zoomType != "lens") { n.zoomLens.css({ "background-size": n.largeWidth / n.newvaluewidth + "px " + n.largeHeight / n.newvaluewidth + "px" }) } n.zoomWindow.css({ "background-size": n.largeWidth / n.newvaluewidth + "px " + n.largeHeight / n.newvaluewidth + "px" }) } n.changeBgSize = false } n.zoomWindow.css({ backgroundPosition: n.xp + "px " + n.yp + "px" }) } }, 16) } } else { if (n.changeBgSize) { if (n.nzHeight > n.nzWidth) { if (n.options.zoomType == "lens") { n.zoomLens.css({ "background-size": n.largeWidth / n.newvalueheight + "px " + n.largeHeight / n.newvalueheight + "px" }) } n.zoomWindow.css({ "background-size": n.largeWidth / n.newvalueheight + "px " + n.largeHeight / n.newvalueheight + "px" }) } else { if (n.options.zoomType == "lens") { n.zoomLens.css({ "background-size": n.largeWidth / n.newvaluewidth + "px " + n.largeHeight / n.newvaluewidth + "px" }) } if (n.largeHeight / n.newvaluewidth < n.options.zoomWindowHeight) { n.zoomWindow.css({ "background-size": n.largeWidth / n.newvaluewidth + "px " + n.largeHeight / n.newvaluewidth + "px" }) } else { n.zoomWindow.css({ "background-size": n.largeWidth / n.newvalueheight + "px " + n.largeHeight / n.newvalueheight + "px" }) } } n.changeBgSize = false } n.zoomWindow.css({ backgroundPosition: n.windowLeftPos + "px " + n.windowTopPos + "px" }) } } }, setTintPosition: function(e) { var t = this; t.nzOffset = t.$elem.offset(); t.tintpos = String((e.pageX - t.nzOffset.left - t.zoomLens.width() / 2) * -1); t.tintposy = String((e.pageY - t.nzOffset.top - t.zoomLens.height() / 2) * -1); if (t.Etoppos) { t.tintposy = 0 } if (t.Eloppos) { t.tintpos = 0 } if (t.Eboppos) { t.tintposy = (t.nzHeight - t.zoomLens.height() - t.options.lensBorderSize * 2) * -1 } if (t.Eroppos) { t.tintpos = (t.nzWidth - t.zoomLens.width() - t.options.lensBorderSize * 2) * -1 } if (t.options.tint) { if (t.fullheight) { t.tintposy = 0 } if (t.fullwidth) { t.tintpos = 0 } t.zoomTintImage.css({ left: t.tintpos + "px" }); t.zoomTintImage.css({ top: t.tintposy + "px" }) } }, swaptheimage: function(t, n) { var r = this; var i = new Image; if (r.options.loadingIcon) { r.spinner = e("<div style=\"background: url('" + r.options.loadingIcon + "') no-repeat center;height:" + r.nzHeight + "px;width:" + r.nzWidth + 'px;z-index: 2000;position: absolute; background-position: center center;"></div>'); r.$elem.after(r.spinner) } r.options.onImageSwap(r.$elem); i.onload = function() { r.largeWidth = i.width; r.largeHeight = i.height; r.zoomImage = n; r.zoomWindow.css({ "background-size": r.largeWidth + "px " + r.largeHeight + "px" }); r.zoomWindow.css({ "background-size": r.largeWidth + "px " + r.largeHeight + "px" }); r.swapAction(t, n); return }; i.src = n }, swapAction: function(t, n) { var r = this; var i = new Image; i.onload = function() { r.nzHeight = i.height; r.nzWidth = i.width; r.options.onImageSwapComplete(r.$elem); r.doneCallback(); return }; i.src = t; r.currentZoomLevel = r.options.zoomLevel; r.options.maxZoomLevel = false; if (r.options.zoomType == "lens") { r.zoomLens.css({ backgroundImage: "url('" + n + "')" }) } if (r.options.zoomType == "window") { r.zoomWindow.css({ backgroundImage: "url('" + n + "')" }) } if (r.options.zoomType == "inner") { r.zoomWindow.css({ backgroundImage: "url('" + n + "')" }) } r.currentImage = n; if (r.options.imageCrossfade) { var s = r.$elem; var o = s.clone(); r.$elem.attr("src", t); r.$elem.after(o); o.stop(true).fadeOut(r.options.imageCrossfade, function() { e(this).remove() }); r.$elem.width("auto").removeAttr("width"); r.$elem.height("auto").removeAttr("height"); s.fadeIn(r.options.imageCrossfade); if (r.options.tint) { var u = r.zoomTintImage; var a = u.clone(); r.zoomTintImage.attr("src", n); r.zoomTintImage.after(a); a.stop(true).fadeOut(r.options.imageCrossfade, function() { e(this).remove() }); u.fadeIn(r.options.imageCrossfade); r.zoomTint.css({ height: r.$elem.height() }); r.zoomTint.css({ width: r.$elem.width() }) } r.zoomContainer.css("height", r.$elem.height()); r.zoomContainer.css("width", r.$elem.width()); if (r.options.zoomType == "inner") { if (!r.options.constrainType) { r.zoomWrap.parent().css("height", r.$elem.height()); r.zoomWrap.parent().css("width", r.$elem.width()); r.zoomWindow.css("height", r.$elem.height()); r.zoomWindow.css("width", r.$elem.width()) } } if (r.options.imageCrossfade) { r.zoomWrap.css("height", r.$elem.height()); r.zoomWrap.css("width", r.$elem.width()) } } else { r.$elem.attr("src", t); if (r.options.tint) { r.zoomTintImage.attr("src", n); r.zoomTintImage.attr("height", r.$elem.height()); r.zoomTintImage.css({ height: r.$elem.height() }); r.zoomTint.css({ height: r.$elem.height() }) } r.zoomContainer.css("height", r.$elem.height()); r.zoomContainer.css("width", r.$elem.width()); if (r.options.imageCrossfade) { r.zoomWrap.css("height", r.$elem.height()); r.zoomWrap.css("width", r.$elem.width()) } } if (r.options.constrainType) { if (r.options.constrainType == "height") { r.zoomContainer.css("height", r.options.constrainSize); r.zoomContainer.css("width", "auto"); if (r.options.imageCrossfade) { r.zoomWrap.css("height", r.options.constrainSize); r.zoomWrap.css("width", "auto"); r.constwidth = r.zoomWrap.width() } else { r.$elem.css("height", r.options.constrainSize); r.$elem.css("width", "auto"); r.constwidth = r.$elem.width() } if (r.options.zoomType == "inner") { r.zoomWrap.parent().css("height", r.options.constrainSize); r.zoomWrap.parent().css("width", r.constwidth); r.zoomWindow.css("height", r.options.constrainSize); r.zoomWindow.css("width", r.constwidth) } if (r.options.tint) { r.tintContainer.css("height", r.options.constrainSize); r.tintContainer.css("width", r.constwidth); r.zoomTint.css("height", r.options.constrainSize); r.zoomTint.css("width", r.constwidth); r.zoomTintImage.css("height", r.options.constrainSize); r.zoomTintImage.css("width", r.constwidth) } } if (r.options.constrainType == "width") { r.zoomContainer.css("height", "auto"); r.zoomContainer.css("width", r.options.constrainSize); if (r.options.imageCrossfade) { r.zoomWrap.css("height", "auto"); r.zoomWrap.css("width", r.options.constrainSize); r.constheight = r.zoomWrap.height() } else { r.$elem.css("height", "auto"); r.$elem.css("width", r.options.constrainSize); r.constheight = r.$elem.height() } if (r.options.zoomType == "inner") { r.zoomWrap.parent().css("height", r.constheight); r.zoomWrap.parent().css("width", r.options.constrainSize); r.zoomWindow.css("height", r.constheight); r.zoomWindow.css("width", r.options.constrainSize) } if (r.options.tint) { r.tintContainer.css("height", r.constheight); r.tintContainer.css("width", r.options.constrainSize); r.zoomTint.css("height", r.constheight); r.zoomTint.css("width", r.options.constrainSize); r.zoomTintImage.css("height", r.constheight); r.zoomTintImage.css("width", r.options.constrainSize) } } } }, doneCallback: function() { var e = this; if (e.options.loadingIcon) { e.spinner.hide() } e.nzOffset = e.$elem.offset(); e.nzWidth = e.$elem.width(); e.nzHeight = e.$elem.height(); e.currentZoomLevel = e.options.zoomLevel; e.widthRatio = e.largeWidth / e.nzWidth; e.heightRatio = e.largeHeight / e.nzHeight; if (e.options.zoomType == "window") { if (e.nzHeight < e.options.zoomWindowWidth / e.widthRatio) { lensHeight = e.nzHeight } else { lensHeight = String(e.options.zoomWindowHeight / e.heightRatio) } if (e.options.zoomWindowWidth < e.options.zoomWindowWidth) { lensWidth = e.nzWidth } else { lensWidth = e.options.zoomWindowWidth / e.widthRatio } if (e.zoomLens) { e.zoomLens.css("width", lensWidth); e.zoomLens.css("height", lensHeight) } } }, getCurrentImage: function() { var e = this; return e.zoomImage }, getGalleryList: function() { var t = this; t.gallerylist = []; if (t.options.gallery) { e("#" + t.options.gallery + " a").each(function() { var n = ""; if (e(this).data("zoom-image")) { n = e(this).data("zoom-image") } else if (e(this).data("image")) { n = e(this).data("image") } if (n == t.zoomImage) { t.gallerylist.unshift({ href: "" + n + "", title: e(this).find("img").attr("title") }) } else { t.gallerylist.push({ href: "" + n + "", title: e(this).find("img").attr("title") }) } }) } else { t.gallerylist.push({ href: "" + t.zoomImage + "", title: e(this).find("img").attr("title") }) } return t.gallerylist }, changeZoomLevel: function(e) { var t = this; t.scrollingLock = true; t.newvalue = parseFloat(e).toFixed(2); newvalue = parseFloat(e).toFixed(2); maxheightnewvalue = t.largeHeight / (t.options.zoomWindowHeight / t.nzHeight * t.nzHeight); maxwidthtnewvalue = t.largeWidth / (t.options.zoomWindowWidth / t.nzWidth * t.nzWidth); if (t.options.zoomType != "inner") { if (maxheightnewvalue <= newvalue) { t.heightRatio = t.largeHeight / maxheightnewvalue / t.nzHeight; t.newvalueheight = maxheightnewvalue; t.fullheight = true } else { t.heightRatio = t.largeHeight / newvalue / t.nzHeight; t.newvalueheight = newvalue; t.fullheight = false } if (maxwidthtnewvalue <= newvalue) { t.widthRatio = t.largeWidth / maxwidthtnewvalue / t.nzWidth; t.newvaluewidth = maxwidthtnewvalue; t.fullwidth = true } else { t.widthRatio = t.largeWidth / newvalue / t.nzWidth; t.newvaluewidth = newvalue; t.fullwidth = false } if (t.options.zoomType == "lens") { if (maxheightnewvalue <= newvalue) { t.fullwidth = true; t.newvaluewidth = maxheightnewvalue } else { t.widthRatio = t.largeWidth / newvalue / t.nzWidth; t.newvaluewidth = newvalue; t.fullwidth = false } } } if (t.options.zoomType == "inner") { maxheightnewvalue = parseFloat(t.largeHeight / t.nzHeight).toFixed(2); maxwidthtnewvalue = parseFloat(t.largeWidth / t.nzWidth).toFixed(2); if (newvalue > maxheightnewvalue) { newvalue = maxheightnewvalue } if (newvalue > maxwidthtnewvalue) { newvalue = maxwidthtnewvalue } if (maxheightnewvalue <= newvalue) { t.heightRatio = t.largeHeight / newvalue / t.nzHeight; if (newvalue > maxheightnewvalue) { t.newvalueheight = maxheightnewvalue } else { t.newvalueheight = newvalue } t.fullheight = true } else { t.heightRatio = t.largeHeight / newvalue / t.nzHeight; if (newvalue > maxheightnewvalue) { t.newvalueheight = maxheightnewvalue } else { t.newvalueheight = newvalue } t.fullheight = false } if (maxwidthtnewvalue <= newvalue) { t.widthRatio = t.largeWidth / newvalue / t.nzWidth; if (newvalue > maxwidthtnewvalue) { t.newvaluewidth = maxwidthtnewvalue } else { t.newvaluewidth = newvalue } t.fullwidth = true } else { t.widthRatio = t.largeWidth / newvalue / t.nzWidth; t.newvaluewidth = newvalue; t.fullwidth = false } } scrcontinue = false; if (t.options.zoomType == "inner") { if (t.nzWidth > t.nzHeight) { if (t.newvaluewidth <= maxwidthtnewvalue) { scrcontinue = true } else { scrcontinue = false; t.fullheight = true; t.fullwidth = true } } if (t.nzHeight > t.nzWidth) { if (t.newvaluewidth <= maxwidthtnewvalue) { scrcontinue = true } else { scrcontinue = false; t.fullheight = true; t.fullwidth = true } } } if (t.options.zoomType != "inner") { scrcontinue = true } if (scrcontinue) { t.zoomLock = 0; t.changeZoom = true; if (t.options.zoomWindowHeight / t.heightRatio <= t.nzHeight) { t.currentZoomLevel = t.newvalueheight; if (t.options.zoomType != "lens" && t.options.zoomType != "inner") { t.changeBgSize = true; t.zoomLens.css({ height: String(t.options.zoomWindowHeight / t.heightRatio) + "px" }) } if (t.options.zoomType == "lens" || t.options.zoomType == "inner") { t.changeBgSize = true } } if (t.options.zoomWindowWidth / t.widthRatio <= t.nzWidth) { if (t.options.zoomType != "inner") { if (t.newvaluewidth > t.newvalueheight) { t.currentZoomLevel = t.newvaluewidth } } if (t.options.zoomType != "lens" && t.options.zoomType != "inner") { t.changeBgSize = true; t.zoomLens.css({ width: String(t.options.zoomWindowWidth / t.widthRatio) + "px" }) } if (t.options.zoomType == "lens" || t.options.zoomType == "inner") { t.changeBgSize = true } } if (t.options.zoomType == "inner") { t.changeBgSize = true; if (t.nzWidth > t.nzHeight) { t.currentZoomLevel = t.newvaluewidth } if (t.nzHeight > t.nzWidth) { t.currentZoomLevel = t.newvaluewidth } } } t.setPosition(t.currentLoc) }, closeAll: function() { if (self.zoomWindow) { self.zoomWindow.hide() } if (self.zoomLens) { self.zoomLens.hide() } if (self.zoomTint) { self.zoomTint.hide() } }, changeState: function(e) { var t = this; if (e == "enable") { t.options.zoomEnabled = true } if (e == "disable") { t.options.zoomEnabled = false } } }; e.fn.elevateZoom = function(t) { return this.each(function() { var n = Object.create(i); n.init(t, this); e.data(this, "elevateZoom", n) }) }; e.fn.elevateZoom.options = { zoomActivation: "hover", zoomEnabled: true, preloading: 1, zoomLevel: 1, scrollZoom: true, scrollZoomIncrement: .1, minZoomLevel: false, maxZoomLevel: false, easing: false, easingAmount: 12, lensSize: 150, zoomWindowWidth: 400, zoomWindowHeight: 400, zoomWindowOffetx: 0, zoomWindowOffety: 0, zoomWindowPosition: 1, zoomWindowBgColour: "#fff", lensFadeIn: false, lensFadeOut: false, debug: false, zoomWindowFadeIn: false, zoomWindowFadeOut: false, zoomWindowAlwaysShow: false, zoomTintFadeIn: false, zoomTintFadeOut: false, borderSize: 4, showLens: true, borderColour: "#888", lensBorderSize: 1, lensBorderColour: "#000", lensShape: "square", zoomType: "window", containLensZoom: true, lensColour: "white", lensOpacity: .4, lenszoom: false, tint: false, tintColour: "#333", tintOpacity: .4, gallery: false, galleryActiveClass: "zoomGalleryActive", imageCrossfade: false, constrainType: false, constrainSize: false, loadingIcon: false, cursor: "default", responsive: true, onComplete: e.noop, onZoomedImageLoaded: function() {}, onImageSwap: e.noop, onImageSwapComplete: e.noop, zoomImage: "" } })(jQuery, window, document)
-----------------------------------------------------------------------------------------------------------------------
CLOUD ZOOM ELEVATE EFFECT
https://www.google.com/search?q=image+zoom+jquery&rlz=1C1CHBF_enGB882GB882&sxsrf=ALeKk00mC-B74HCFvQopqpt2DejnfFnWig:1592611867552&source=lnms&tbm=isch&sa=X&ved=2ahUKEwi-noXFjY_qAhXZVRUIHRssAfIQ_AUoAXoECAwQAw&biw=1366&bih=576
----------------------------------------------------------------------------------------------------------------------
ELEVATE ZOOM JAVA SCRIPT
NEED TWO JAVA FILE
1) JQUERY MIN VERSION 1.8.3
2)ELEVATE ZOOM MIN JS FILE
3) BETWEEN HEAD TAG CODE FOR ZOOM STYLE LIKE
var zoom_lens_shape = "square";4) NEED ONE OR TWO IMAGES IN HTML
https://community.shopify.com/c/Shopify-Discussion/variant-images-and-their-thumbnails/td-p/207701
https://bonpresta.com/
https://module-presta.com/digitalbox-prestashop-1-6-theme.html
https://www.prestashop.com/forums/topic/955354-free-best-zoom-magnifier-effect-bazoom-magnifier/
https://buy-addons.com/store/prestashop/best-zoom-magnifier-effect-bazoom-magnifier.html#utm_source=prestashop_zoom-magnifier-effect_post&utm_medium=prestashop_zoom-magnifier-effect_post&utm_campaign=prestashop_forum
https://prestashop-demo.com/1000demo/frontend.php
https://prestashop-demo.com/1000demo/prestashop_16/blouses/2-blouse.html
http://livedemo00.template-help.com/free_prestashop_1_6_template/index.php?id_product=2&controller=product&id_lang=1
https://www.chiphost.org/blog/prestashop-ecommerce-themes/
SHOPIFY ELEVATE ZOOM
https://theme232-handbags.myshopify.com/products/alexander_mcqueen_mini_heroine?variant=14889902407
https://www.themelock.com/ecommerce/687015779-bigsale-v100-the-clean-minimal-unlimited-bootstrap-4-shopify-theme-12-homepages.html
----------------------------------------------------------------------------------------------------------------------
HOW TO ZOOM WINDOW IMAGE BACKGROUND FIXED AND
ZOOM LENS SIZE FIX
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script> <script src="https://www.elevateweb.co.uk/wp-content/themes/radial/jquery.elevatezoom.min.js" type="text/javascript"></script> <script type="text/javascript">
$(document).ready(function () { https://initiate the plugin and pass the id of the div containing gallery images var thumareaSize = $('.bigimage > img').width(); $('.thumb-area').css('width',thumareaSize +'px'); $("#zoom_01").elevateZoom({ gallery:'zoom_01-gallery', cursor: 'pointer', galleryActiveClass: 'active', borderColour: '#eee', borderSize: '1' }); }); $(window).load(function() { var thumareaSize = $('.bigimage > img').width(); $('.thumb-area').css('width',thumareaSize +'px'); });
</script> </head> <body> <img style="border:1px solid #e8e8e6;" id="zoom_01" src="http://www.elevateweb.co.uk/wp-content/themes/radial/zoom/images/small/image1.png" data-zoom-image="http://www.elevateweb.co.uk/wp-content/themes/radial/zoom/images/large/image1.jpg" width="411"> <div style="clear:both;"></div> <script type="text/javascript"> </script> </div> </body> </html>----------------------------------------------------------------------------------------------------------------------
FOR DIFFERENT TIN EFFECTS CODE ADD AND CHANGE IMAGE ID
https://www.elevateweb.co.uk/image-zoom/examples/#zoom-constrain
$(document).ready(function(){
$("#zoom_01").elevateZoom({tint:true, tintColour:'Blue', tintOpacity:0.5});
});
<!-- saved from url=(0049)https://www.elevateweb.co.uk/image-zoom/examples/ -->
<!-- https://github.com/elevateweb/elevatezoom -->
<!-- https://www.templatemonsterpreview.com/demo/51683.html -->
<!-- https://codepen.io/asifsaho/pen/vNrXzp -->
<!-- https://www.apress.com/gp/book/9781430247166 -->
<!-- http://chubika.com/home/83-square-labyrinth-jacket-.html -->
https://mail.google.com/mail/u/0?ui=2&ik=a259a72959&attid=0.1&permmsgid=msg-a:r8415067067666889463&th=172f1f04249df575&view=att&disp=safe&realattid=f_kbwkbhdj0
<!-- https://www.shoevillage.com/collections/apparel-men-hoodies/products/mt91547 --> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script> <script src="https://www.elevateweb.co.uk/wp-content/themes/radial/jquery.elevatezoom.min.js" type="text/javascript"></script> <script type="text/javascript"> var zoom_type = "window"; var zoom_lens_size = "150"; var zoom_cursor_type = "crosshair"; var zoom_lens_opacity = "0.5"; var zoom_scroll = "#229cff"; var zoom_easing = "0"; var zoom_fade_in = "1400"; var zoom_fade_out = "500"; var zoom_lens_shape = "square";
function applyElevateZoom(){ var src = $('.thickbox.shown').attr('href'); var bigimage = $('.fancybox.shown').attr('href'); $('#zoom_01').elevateZoom({ zoomType: zoom_type, cursor: zoom_cursor_type, zoomWindowFadeIn: zoom_fade_in, zoomWindowFadeOut: zoom_fade_out, scrollZoom: zoom_scroll, easing: zoom_easing, lensOpacity: zoom_lens_opacity, lensShape: zoom_lens_shape, lensSize: zoom_lens_size, zoomImage: bigimage }); }
$(document).ready(function(){
applyElevateZoom();$('#color_to_pick_list').click( function(){ restartElevateZoom(); } ); $('#color_to_pick_list').hover( function(){ restartElevateZoom(); } ); $('#views_block li a').hover( function(){ restartElevateZoom(); } );
/*
HOW TO ADD TINT EFFECT TO RUN THIS CODE REMOVE ASTERIC SLASH
$("#zoom_01").elevateZoom({tint:true, tintColour:'Blue', tintOpacity:0.5});
*/
}); function restartElevateZoom(){ $(".zoomContainer").remove(); applyElevateZoom(); }
</script> </head> <body> <img style="border:1px solid #e8e8e6;" id="zoom_01" src="http://www.elevateweb.co.uk/wp-content/themes/radial/zoom/images/small/image1.png" data-zoom-image="http://www.elevateweb.co.uk/wp-content/themes/radial/zoom/images/large/image1.jpg" width="411"> <div style="clear:both;"></div> <script type="text/javascript"> </script> </div> </body> </html>----------------------------------------------------------------------------------------------------------------------
π Ώππ ΄πππ ° π ΄π »π ΄π π °ππ ΄ππ Ύπ Ύπ Ό π ²π Έππ ²π »π ΄ π »π ΄π ½π π ΄π ΅π ΅π ΄π ²π
----------------------------------------------------------------------------------------------------------------------ELEVATE ZOOM JQUERY MIN FILE
https://textuploader.com/1m7h7
http://chubika.com/modules/elevatezoom/js/jquery.elevatezoom.min.js
<!DOCTYPE html> <!-- saved from url=(0056)http://chubika.com/home/83-square-labyrinth-jacket-.html --> <html> <head> <script type="text/javascript">var productAvailableForOrder = true; var productBasePriceTaxExcl = 2000; var productBasePriceTaxExcluded = 2000; var productHasAttributes = false; var productPrice = 2000; var productPriceTaxExcluded = 2000; var productPriceWithoutReduction = 2000; var productReference = ''; var productShowPrice = true; var productUnitPriceRatio = 0; var product_fileButtonHtml = 'Choose File'; var product_fileDefaultHtml = 'No file selected'; var product_specific_price = []; var quantitiesDisplayAllowed = false; var quantityAvailable = 0; var quickView = false; var search_url = 'http://chubika.com/search'; </script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script type="text/javascript" src="http://chubika.com/modules/elevatezoom/js/jquery.elevatezoom.min.js"></script> <script type="text/javascript"> var zoom_type = 'lens'; var zoom_fade_in = 400; var zoom_fade_out = 550; var zoom_cursor_type = 'crosshair'; var zoom_window_pos = 1; var zoom_scroll = true; var zoom_easing = true; var zoom_tint = true; var zoom_tint_color = '#000'; var zoom_tint_opacity = 0.4; var zoom_lens_shape = 'round'; var zoom_lens_size = 200; </script> <script type="text/javascript"> function applyElevateZoom(){ var src = $('.thickbox.shown').attr('href'); var bigimage = $('.fancybox.shown').attr('href'); $('#bigpic').elevateZoom({ zoomType: zoom_type, cursor: zoom_cursor_type, zoomWindowFadeIn: zoom_fade_in, zoomWindowFadeOut: zoom_fade_out, zoomWindowPosition: zoom_window_pos, scrollZoom: zoom_scroll, easing: zoom_easing, tint: zoom_tint, tintColour: zoom_tint_color, tintOpacity: zoom_tint_opacity, lensShape: zoom_lens_shape, lensSize: zoom_lens_size, zoomImage: bigimage }); } $(document).ready(function(){ applyElevateZoom(); $('#color_to_pick_list').click( function(){ restartElevateZoom(); } ); $('#color_to_pick_list').hover( function(){ restartElevateZoom(); } ); $('#views_block li a').hover( function(){ restartElevateZoom(); } ); }); function restartElevateZoom(){ $(".zoomContainer").remove(); applyElevateZoom(); } </script> </head> <body> <span id="view_full_size"> <img id="bigpic" itemprop="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5D9pEM-OoZzNs5rcq6NKrsi2E5tPq0etGs8YFxXz4uc9hFcV_SzAOaON71dPuSP5-vU6TKt6whPIvNLx6UFLsAX7DuXMXVP8NU7Exl0yV27prbOKZnwFmfUXL2ZMFnVnwCA8AduANYwPH/s500-no/?authuser=0" title="Square Labyrinth Jacket" alt="Square Labyrinth Jacket"> </span> </body> </html>-------------------------------------------------------------------------------------
π
Ώππ
΄πππ
° π
΄π
»π
΄π
π
°ππ
΄ππ
Ύπ
Ύπ
Ό ππ
Έπ
½π
³π
Ύπ π
»π
΄π
½π π
΄π
΅π
΅π
΄π
²π
-------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------<!-- saved from url=(0066)https://bonpresta.com/en/tshirts/1-faded-short-sleeves-tshirt.html --> <html> <head> <script type="text/javascript" src="https://bonpresta.com/themes/default-bootstrap/cache/v_193_27d0d86398920adc49a728fd97ab5e35.js"></script> <script type="text/javascript"> var zoom_type = "window", zoom_lens_size = "100", zoom_cursor_type = "default", zoom_lens_opacity = "0.5", zoom_scroll = "0", zoom_easing = "1", zoom_fade_in = "1400", zoom_fade_out = "500", zoom_lens_shape = "square", zoom_win_width = "400", zoom_win_height = "400", zoom_win_border = "1"; zoom_win_border_color = "#333333"; function applyElevateZoom() { var src = $('.thickbox.shown').attr('href'), bigimage = $('.fancybox.shown').attr('href'); $('#bigpic').elevateZoom({ zoomType: zoom_type, cursor: zoom_cursor_type, zoomWindowFadeIn: zoom_fade_in, zoomWindowFadeOut: zoom_fade_out, scrollZoom: zoom_scroll, easing: zoom_easing, lensOpacity: zoom_lens_opacity, lensShape: zoom_lens_shape, lensSize: zoom_lens_size, zoomImage: bigimage, zoomWindowWidth: zoom_win_width, zoomWindowHeight: zoom_win_height, borderSize: zoom_win_border, borderColour: zoom_win_border_color, }); } $(document).ready(function () { applyElevateZoom(); $('#color_to_pick_list').click(function () { restartElevateZoom(); }); $('#color_to_pick_list').hover(function () { restartElevateZoom(); }); $('#views_block li a').hover(function () { restartElevateZoom(); }); }); function restartElevateZoom() { $(".zoomContainer").remove(); applyElevateZoom(); };; var BONCONFIG_COUNTER_DISPLAY = 1; var BONCONFIG_COUNTER_DELAY = 10; var BONCONFIG_COUNTER_TIME = 1000;; var PRELOADER_ITEM_STATUS = 1; var PRELOADER_ITEM_BACKGROUND = '#ffffff'; var PRELOADER_ITEM_STYLE = 'loader'; var PRELOADER_ITEM_IMAGE = '/modules/preloading/views/img/preloader.gif';; </script> </head> <body> <img id="bigpic" itemprop="image" src="https://bonpresta.com/3-large_default/faded-short-sleeves-tshirt.jpg" title="Faded Short Sleeves T-shirt" alt="Faded Short Sleeves T-shirt" width="458" height="458"> </body> </html>
ELEVATE ZOOM JQUERY MIN FILE
-----------------------------------------------------------------------------------------------------------------------if (typeof Object.create !== "function") { Object.create = function(e) { function t() {} t.prototype = e; return new t } }(function(e, t, n, r) { var i = { init: function(t, n) { var r = this; r.elem = n; r.$elem = e(n); r.imageSrc = r.$elem.data("zoom-image") ? r.$elem.data("zoom-image") : r.$elem.attr("src"); r.options = e.extend({}, e.fn.elevateZoom.options, t); if (r.options.zoomImage != "") r.imageSrc = r.options.zoomImage; if (r.options.tint) { r.options.lensColour = "none", r.options.lensOpacity = "1" } if (r.options.zoomType == "inner") { r.options.showLens = false; r.options.tint = false } if (r.options.zoomType == "lens") { r.options.tint = false } r.$elem.parent().removeAttr("title").removeAttr("alt"); r.zoomImage = r.imageSrc; r.refresh(1); e("#" + r.options.gallery + " a").click(function(t) { if (r.options.galleryActiveClass) { e("#" + r.options.gallery + " a").removeClass(r.options.galleryActiveClass); e(this).addClass(r.options.galleryActiveClass) } t.preventDefault(); if (e(this).data("zoom-image")) { r.zoomImagePre = e(this).data("image") } else { r.zoomImagePre = e(this).data("zoom-image") } r.swaptheimage(e(this).data("image"), r.zoomImagePre); return false }) }, refresh: function(e) { var t = this; setTimeout(function() { t.fetch(t.imageSrc) }, e || t.options.refresh) }, fetch: function(e) { var t = this; var n = new Image; n.onload = function() { t.largeWidth = n.width; t.largeHeight = n.height; t.startZoom(); t.currentImage = t.imageSrc; t.options.onZoomedImageLoaded(t.$elem) }; n.src = e; return }, startZoom: function() { var t = this; t.nzWidth = t.$elem.width(); t.nzHeight = t.$elem.height(); t.isWindowActive = false; t.isLensActive = false; t.isTintActive = false; t.overWindow = false; if (t.options.imageCrossfade) { t.zoomWrap = t.$elem.wrap('<div style="height:' + t.nzHeight + "px;width:" + t.nzWidth + 'px;" class="zoomWrapper" />'); t.$elem.css("position", "absolute") } t.zoomLock = 1; t.scrollingLock = false; t.changeBgSize = false; t.currentZoomLevel = t.options.zoomLevel; t.nzOffset = t.$elem.offset(); t.widthRatio = t.largeWidth / t.currentZoomLevel / t.nzWidth; t.heightRatio = t.largeHeight / t.currentZoomLevel / t.nzHeight; if (t.options.zoomType == "window") { t.zoomWindowStyle = "overflow: hidden;" + "background-position: 0px 0px;text-align:center;" + "background-color: " + String(t.options.zoomWindowBgColour) + ";width: " + String(t.options.zoomWindowWidth) + "px;" + "height: " + String(t.options.zoomWindowHeight) + "px;float: left;" + "background-size: " + t.largeWidth / t.currentZoomLevel + "px " + t.largeHeight / t.currentZoomLevel + "px;" + "display: none;z-index:100;" + "border: " + String(t.options.borderSize) + "px solid " + t.options.borderColour + ";background-repeat: no-repeat;" + "position: absolute;" } if (t.options.zoomType == "inner") { var n = t.$elem.css("border-left-width"); t.zoomWindowStyle = "overflow: hidden;" + "margin-left: " + String(n) + ";" + "margin-top: " + String(n) + ";" + "background-position: 0px 0px;" + "width: " + String(t.nzWidth) + "px;" + "height: " + String(t.nzHeight) + "px;float: left;" + "display: none;" + "cursor:" + t.options.cursor + ";" + "background-size: " + t.largeWidth / t.currentZoomLevel + "px " + t.largeHeight / t.currentZoomLevel + "px;" + "px solid " + t.options.borderColour + ";background-repeat: no-repeat;" + "position: absolute;" } if (t.options.zoomType == "window") { if (t.nzHeight < t.options.zoomWindowWidth / t.widthRatio) { lensHeight = t.nzHeight } else { lensHeight = String(t.options.zoomWindowHeight / t.heightRatio) } if (t.largeWidth < t.options.zoomWindowWidth) { lensWidth = t.nzWidth } else { lensWidth = t.options.zoomWindowWidth / t.widthRatio } t.lensStyle = "background-position: 0px 0px;width: " + String(t.options.zoomWindowWidth / t.widthRatio) + "px;height: " + String(t.options.zoomWindowHeight / t.heightRatio) + "px;float: right;display: none;" + "overflow: hidden;" + "z-index: 999;" + "opacity:" + t.options.lensOpacity + ";filter: alpha(opacity = " + t.options.lensOpacity * 100 + "); zoom:1;" + "width:" + lensWidth + "px;" + "height:" + lensHeight + "px;" + "background-color:" + t.options.lensColour + ";" + "cursor:" + t.options.cursor + ";" + "border: " + t.options.lensBorderSize + "px" + " solid " + t.options.lensBorderColour + ";background-repeat: no-repeat;position: absolute;" } t.tintStyle = "display: block;" + "position: absolute;" + "z-index: 990;" + "background-color: " + t.options.tintColour + ";" + "filter:alpha(opacity=0);" + "opacity: 0;" + "width: " + t.nzWidth + "px;" + "height: " + t.nzHeight + "px;"; t.lensRound = ""; if (t.options.zoomType == "lens") { t.lensStyle = "background-position: 0px 0px;" + "z-index: 999;" + "float: left;display: none;" + "border: " + String(t.options.borderSize) + "px solid " + t.options.borderColour + ";" + "width:" + String(t.options.lensSize) + "px;" + "height:" + String(t.options.lensSize) + "px;" + "background-size: " + t.largeWidth / t.currentZoomLevel + "px " + t.largeHeight / t.currentZoomLevel + "px;" + "background-repeat: no-repeat;position: absolute;" } if (t.options.lensShape == "round") { t.lensRound = "border-top-left-radius: " + String(t.options.lensSize / 2 + t.options.borderSize) + "px;" + "border-top-right-radius: " + String(t.options.lensSize / 2 + t.options.borderSize) + "px;" + "border-bottom-left-radius: " + String(t.options.lensSize / 2 + t.options.borderSize) + "px;" + "border-bottom-right-radius: " + String(t.options.lensSize / 2 + t.options.borderSize) + "px;" } t.zoomContainer = e('<div class="zoomContainer" style="position:absolute;left:' + t.nzOffset.left + "px;top:" + t.nzOffset.top + "px;height:" + t.nzHeight + "px;width:" + t.nzWidth + 'px;"></div>'); e("body").append(t.zoomContainer); if (t.options.containLensZoom && t.options.zoomType == "lens") { t.zoomContainer.css("overflow", "hidden") } if (t.options.zoomType != "inner") { t.zoomLens = e("<div class='zoomLens' style='" + t.lensStyle + t.lensRound + "'> </div>").appendTo(t.zoomContainer).click(function() { t.$elem.trigger("click") }); if (t.options.tint && t.options.zoomType != "inner") { t.tintContainer = e("<div/>").addClass("tintContainer"); t.zoomTint = e("<div class='zoomTint' style='" + t.tintStyle + "'></div>"); t.zoomLens.wrap(t.tintContainer); t.zoomTintcss = t.zoomLens.after(t.zoomTint); t.zoomTintImage = e('<img style="position: absolute; left: 0px; top: 0px; max-width: none; width: ' + t.nzWidth + "px; height: " + t.nzHeight + 'px;" src="' + t.$elem.attr("src") + '">').appendTo(t.zoomLens).click(function() { t.$elem.trigger("click") }) } } if (isNaN(t.options.zoomWindowPosition)) { t.zoomWindow = e("<div style='z-index:999;left:" + t.windowOffsetLeft + "px;top:" + t.windowOffsetTop + "px;" + t.zoomWindowStyle + "' class='zoomWindow'> </div>").appendTo("body").click(function() { t.$elem.trigger("click") }) } else { t.zoomWindow = e("<div style='z-index:999;left:" + t.windowOffsetLeft + "px;top:" + t.windowOffsetTop + "px;" + t.zoomWindowStyle + "' class='zoomWindow'> </div>").appendTo(t.zoomContainer).click(function() { t.$elem.trigger("click") }) } t.zoomWindowContainer = e("<div/>").addClass("zoomWindowContainer").css("width", t.options.zoomWindowWidth); t.zoomWindow.wrap(t.zoomWindowContainer); if (t.options.zoomType == "lens") { t.zoomLens.css({ backgroundImage: "url('" + t.imageSrc + "')" }) } if (t.options.zoomType == "window") { t.zoomWindow.css({ backgroundImage: "url('" + t.imageSrc + "')" }) } if (t.options.zoomType == "inner") { t.zoomWindow.css({ backgroundImage: "url('" + t.imageSrc + "')" }) } t.$elem.bind("touchmove", function(e) { e.preventDefault(); var n = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; t.setPosition(n) }); t.zoomContainer.bind("touchmove", function(e) { if (t.options.zoomType == "inner") { t.showHideWindow("show") } e.preventDefault(); var n = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; t.setPosition(n) }); t.zoomContainer.bind("touchend", function(e) { t.showHideWindow("hide"); if (t.options.showLens) { t.showHideLens("hide") } if (t.options.tint && t.options.zoomType != "inner") { t.showHideTint("hide") } }); t.$elem.bind("touchend", function(e) { t.showHideWindow("hide"); if (t.options.showLens) { t.showHideLens("hide") } if (t.options.tint && t.options.zoomType != "inner") { t.showHideTint("hide") } }); if (t.options.showLens) { t.zoomLens.bind("touchmove", function(e) { e.preventDefault(); var n = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; t.setPosition(n) }); t.zoomLens.bind("touchend", function(e) { t.showHideWindow("hide"); if (t.options.showLens) { t.showHideLens("hide") } if (t.options.tint && t.options.zoomType != "inner") { t.showHideTint("hide") } }) } t.$elem.bind("mousemove", function(e) { if (t.overWindow == false) { t.setElements("show") } if (t.lastX !== e.clientX || t.lastY !== e.clientY) { t.setPosition(e); t.currentLoc = e } t.lastX = e.clientX; t.lastY = e.clientY }); t.zoomContainer.bind("mousemove", function(e) { if (t.overWindow == false) { t.setElements("show") } if (t.lastX !== e.clientX || t.lastY !== e.clientY) { t.setPosition(e); t.currentLoc = e } t.lastX = e.clientX; t.lastY = e.clientY }); if (t.options.zoomType != "inner") { t.zoomLens.bind("mousemove", function(e) { if (t.lastX !== e.clientX || t.lastY !== e.clientY) { t.setPosition(e); t.currentLoc = e } t.lastX = e.clientX; t.lastY = e.clientY }) } if (t.options.tint && t.options.zoomType != "inner") { t.zoomTint.bind("mousemove", function(e) { if (t.lastX !== e.clientX || t.lastY !== e.clientY) { t.setPosition(e); t.currentLoc = e } t.lastX = e.clientX; t.lastY = e.clientY }) } if (t.options.zoomType == "inner") { t.zoomWindow.bind("mousemove", function(e) { if (t.lastX !== e.clientX || t.lastY !== e.clientY) { t.setPosition(e); t.currentLoc = e } t.lastX = e.clientX; t.lastY = e.clientY }) } t.zoomContainer.add(t.$elem).mouseenter(function() { if (t.overWindow == false) { t.setElements("show") } }).mouseleave(function() { if (!t.scrollLock) { t.setElements("hide") } }); if (t.options.zoomType != "inner") { t.zoomWindow.mouseenter(function() { t.overWindow = true; t.setElements("hide") }).mouseleave(function() { t.overWindow = false }) } if (t.options.zoomLevel != 1) {} if (t.options.minZoomLevel) { t.minZoomLevel = t.options.minZoomLevel } else { t.minZoomLevel = t.options.scrollZoomIncrement * 2 } if (t.options.scrollZoom) { t.zoomContainer.add(t.$elem).bind("mousewheel DOMMouseScroll MozMousePixelScroll", function(n) { t.scrollLock = true; clearTimeout(e.data(this, "timer")); e.data(this, "timer", setTimeout(function() { t.scrollLock = false }, 250)); var r = n.originalEvent.wheelDelta || n.originalEvent.detail * -1; n.stopImmediatePropagation(); n.stopPropagation(); n.preventDefault(); if (t.options.zoomType != "inner") { if (r / 120 > 0) { if (t.currentZoomLevel >= t.minZoomLevel) { t.changeZoomLevel(t.currentZoomLevel - t.options.scrollZoomIncrement) } } else { if (t.options.maxZoomLevel) { if (t.currentZoomLevel <= t.options.maxZoomLevel) { t.changeZoomLevel(parseFloat(t.currentZoomLevel) + t.options.scrollZoomIncrement) } } else { t.changeZoomLevel(parseFloat(t.currentZoomLevel) + t.options.scrollZoomIncrement) } } } return false }) } }, setElements: function(e) { var t = this; if (!t.options.zoomEnabled) { return false } if (e == "show") { if (t.isWindowSet) { if (t.options.zoomType == "inner") { t.showHideWindow("show") } if (t.options.zoomType == "window") { t.showHideWindow("show") } if (t.options.showLens) { t.showHideLens("show") } if (t.options.tint && t.options.zoomType != "inner") { t.showHideTint("show") } } } if (e == "hide") { if (t.options.zoomType == "window") { t.showHideWindow("hide") } if (!t.options.tint) { t.showHideWindow("hide") } if (t.options.showLens) { t.showHideLens("hide") } if (t.options.tint) { t.showHideTint("hide") } } }, setPosition: function(e) { var t = this; if (!t.options.zoomEnabled) { return false } t.nzHeight = t.$elem.height(); t.nzWidth = t.$elem.width(); t.nzOffset = t.$elem.offset(); if (t.options.tint && t.options.zoomType != "inner") { t.zoomTint.css({ top: 0 }); t.zoomTint.css({ left: 0 }) } if (t.options.responsive && !t.options.scrollZoom) { if (t.options.showLens) { if (t.nzHeight < t.options.zoomWindowWidth / t.widthRatio) { lensHeight = t.nzHeight } else { lensHeight = String(t.options.zoomWindowHeight / t.heightRatio) } if (t.largeWidth < t.options.zoomWindowWidth) { lensWidth = t.nzWidth } else { lensWidth = t.options.zoomWindowWidth / t.widthRatio } t.widthRatio = t.largeWidth / t.nzWidth; t.heightRatio = t.largeHeight / t.nzHeight; if (t.options.zoomType != "lens") { if (t.nzHeight < t.options.zoomWindowWidth / t.widthRatio) { lensHeight = t.nzHeight } else { lensHeight = String(t.options.zoomWindowHeight / t.heightRatio) } if (t.options.zoomWindowWidth < t.options.zoomWindowWidth) { lensWidth = t.nzWidth } else { lensWidth = t.options.zoomWindowWidth / t.widthRatio } t.zoomLens.css("width", lensWidth); t.zoomLens.css("height", lensHeight); if (t.options.tint && t.options.zoomType != "inner") { t.zoomTintImage.css("width", t.nzWidth); t.zoomTintImage.css("height", t.nzHeight) } } if (t.options.zoomType == "lens") { t.zoomLens.css({ width: String(t.options.lensSize) + "px", height: String(t.options.lensSize) + "px" }) } } } t.zoomContainer.css({ top: t.nzOffset.top }); t.zoomContainer.css({ left: t.nzOffset.left }); t.mouseLeft = parseInt(e.pageX - t.nzOffset.left); t.mouseTop = parseInt(e.pageY - t.nzOffset.top); if (t.options.zoomType == "window") { t.Etoppos = t.mouseTop < t.zoomLens.height() / 2; t.Eboppos = t.mouseTop > t.nzHeight - t.zoomLens.height() / 2 - t.options.lensBorderSize * 2; t.Eloppos = t.mouseLeft < 0 + t.zoomLens.width() / 2; t.Eroppos = t.mouseLeft > t.nzWidth - t.zoomLens.width() / 2 - t.options.lensBorderSize * 2 } if (t.options.zoomType == "inner") { t.Etoppos = t.mouseTop < t.nzHeight / 2 / t.heightRatio; t.Eboppos = t.mouseTop > t.nzHeight - t.nzHeight / 2 / t.heightRatio; t.Eloppos = t.mouseLeft < 0 + t.nzWidth / 2 / t.widthRatio; t.Eroppos = t.mouseLeft > t.nzWidth - t.nzWidth / 2 / t.widthRatio - t.options.lensBorderSize * 2 } if (t.mouseLeft <= 0 || t.mouseTop < 0 || t.mouseLeft > t.nzWidth || t.mouseTop > t.nzHeight) { t.setElements("hide"); return } else { if (t.options.showLens) { t.lensLeftPos = String(t.mouseLeft - t.zoomLens.width() / 2); t.lensTopPos = String(t.mouseTop - t.zoomLens.height() / 2) } if (t.Etoppos) { t.lensTopPos = 0 } if (t.Eloppos) { t.windowLeftPos = 0; t.lensLeftPos = 0; t.tintpos = 0 } if (t.options.zoomType == "window") { if (t.Eboppos) { t.lensTopPos = Math.max(t.nzHeight - t.zoomLens.height() - t.options.lensBorderSize * 2, 0) } if (t.Eroppos) { t.lensLeftPos = t.nzWidth - t.zoomLens.width() - t.options.lensBorderSize * 2 } } if (t.options.zoomType == "inner") { if (t.Eboppos) { t.lensTopPos = Math.max(t.nzHeight - t.options.lensBorderSize * 2, 0) } if (t.Eroppos) { t.lensLeftPos = t.nzWidth - t.nzWidth - t.options.lensBorderSize * 2 } } if (t.options.zoomType == "lens") { t.windowLeftPos = String(((e.pageX - t.nzOffset.left) * t.widthRatio - t.zoomLens.width() / 2) * -1); t.windowTopPos = String(((e.pageY - t.nzOffset.top) * t.heightRatio - t.zoomLens.height() / 2) * -1); t.zoomLens.css({ backgroundPosition: t.windowLeftPos + "px " + t.windowTopPos + "px" }); if (t.changeBgSize) { if (t.nzHeight > t.nzWidth) { if (t.options.zoomType == "lens") { t.zoomLens.css({ "background-size": t.largeWidth / t.newvalueheight + "px " + t.largeHeight / t.newvalueheight + "px" }) } t.zoomWindow.css({ "background-size": t.largeWidth / t.newvalueheight + "px " + t.largeHeight / t.newvalueheight + "px" }) } else { if (t.options.zoomType == "lens") { t.zoomLens.css({ "background-size": t.largeWidth / t.newvaluewidth + "px " + t.largeHeight / t.newvaluewidth + "px" }) } t.zoomWindow.css({ "background-size": t.largeWidth / t.newvaluewidth + "px " + t.largeHeight / t.newvaluewidth + "px" }) } t.changeBgSize = false } t.setWindowPostition(e) } if (t.options.tint && t.options.zoomType != "inner") { t.setTintPosition(e) } if (t.options.zoomType == "window") { t.setWindowPostition(e) } if (t.options.zoomType == "inner") { t.setWindowPostition(e) } if (t.options.showLens) { if (t.fullwidth && t.options.zoomType != "lens") { t.lensLeftPos = 0 } t.zoomLens.css({ left: t.lensLeftPos + "px", top: t.lensTopPos + "px" }) } } }, showHideWindow: function(e) { var t = this; if (e == "show") { if (!t.isWindowActive) { if (t.options.zoomWindowFadeIn) { t.zoomWindow.stop(true, true, false).fadeIn(t.options.zoomWindowFadeIn) } else { t.zoomWindow.show() } t.isWindowActive = true } } if (e == "hide") { if (t.isWindowActive) { if (t.options.zoomWindowFadeOut) { t.zoomWindow.stop(true, true).fadeOut(t.options.zoomWindowFadeOut) } else { t.zoomWindow.hide() } t.isWindowActive = false } } }, showHideLens: function(e) { var t = this; if (e == "show") { if (!t.isLensActive) { if (t.options.lensFadeIn) { t.zoomLens.stop(true, true, false).fadeIn(t.options.lensFadeIn) } else { t.zoomLens.show() } t.isLensActive = true } } if (e == "hide") { if (t.isLensActive) { if (t.options.lensFadeOut) { t.zoomLens.stop(true, true).fadeOut(t.options.lensFadeOut) } else { t.zoomLens.hide() } t.isLensActive = false } } }, showHideTint: function(e) { var t = this; if (e == "show") { if (!t.isTintActive) { if (t.options.zoomTintFadeIn) { t.zoomTint.css({ opacity: t.options.tintOpacity }).animate().stop(true, true).fadeIn("slow") } else { t.zoomTint.css({ opacity: t.options.tintOpacity }).animate(); t.zoomTint.show() } t.isTintActive = true } } if (e == "hide") { if (t.isTintActive) { if (t.options.zoomTintFadeOut) { t.zoomTint.stop(true, true).fadeOut(t.options.zoomTintFadeOut) } else { t.zoomTint.hide() } t.isTintActive = false } } }, setLensPostition: function(e) {}, setWindowPostition: function(t) { var n = this; if (!isNaN(n.options.zoomWindowPosition)) { switch (n.options.zoomWindowPosition) { case 1: n.windowOffsetTop = n.options.zoomWindowOffety; n.windowOffsetLeft = +n.nzWidth; break; case 2: if (n.options.zoomWindowHeight > n.nzHeight) { n.windowOffsetTop = (n.options.zoomWindowHeight / 2 - n.nzHeight / 2) * -1; n.windowOffsetLeft = n.nzWidth } else {} break; case 3: n.windowOffsetTop = n.nzHeight - n.zoomWindow.height() - n.options.borderSize * 2; n.windowOffsetLeft = n.nzWidth; break; case 4: n.windowOffsetTop = n.nzHeight; n.windowOffsetLeft = n.nzWidth; break; case 5: n.windowOffsetTop = n.nzHeight; n.windowOffsetLeft = n.nzWidth - n.zoomWindow.width() - n.options.borderSize * 2; break; case 6: if (n.options.zoomWindowHeight > n.nzHeight) { n.windowOffsetTop = n.nzHeight; n.windowOffsetLeft = (n.options.zoomWindowWidth / 2 - n.nzWidth / 2 + n.options.borderSize * 2) * -1 } else {} break; case 7: n.windowOffsetTop = n.nzHeight; n.windowOffsetLeft = 0; break; case 8: n.windowOffsetTop = n.nzHeight; n.windowOffsetLeft = (n.zoomWindow.width() + n.options.borderSize * 2) * -1; break; case 9: n.windowOffsetTop = n.nzHeight - n.zoomWindow.height() - n.options.borderSize * 2; n.windowOffsetLeft = (n.zoomWindow.width() + n.options.borderSize * 2) * -1; break; case 10: if (n.options.zoomWindowHeight > n.nzHeight) { n.windowOffsetTop = (n.options.zoomWindowHeight / 2 - n.nzHeight / 2) * -1; n.windowOffsetLeft = (n.zoomWindow.width() + n.options.borderSize * 2) * -1 } else {} break; case 11: n.windowOffsetTop = n.options.zoomWindowOffety; n.windowOffsetLeft = (n.zoomWindow.width() + n.options.borderSize * 2) * -1; break; case 12: n.windowOffsetTop = (n.zoomWindow.height() + n.options.borderSize * 2) * -1; n.windowOffsetLeft = (n.zoomWindow.width() + n.options.borderSize * 2) * -1; break; case 13: n.windowOffsetTop = (n.zoomWindow.height() + n.options.borderSize * 2) * -1; n.windowOffsetLeft = 0; break; case 14: if (n.options.zoomWindowHeight > n.nzHeight) { n.windowOffsetTop = (n.zoomWindow.height() + n.options.borderSize * 2) * -1; n.windowOffsetLeft = (n.options.zoomWindowWidth / 2 - n.nzWidth / 2 + n.options.borderSize * 2) * -1 } else {} break; case 15: n.windowOffsetTop = (n.zoomWindow.height() + n.options.borderSize * 2) * -1; n.windowOffsetLeft = n.nzWidth - n.zoomWindow.width() - n.options.borderSize * 2; break; case 16: n.windowOffsetTop = (n.zoomWindow.height() + n.options.borderSize * 2) * -1; n.windowOffsetLeft = n.nzWidth; break; default: n.windowOffsetTop = n.options.zoomWindowOffety; n.windowOffsetLeft = n.nzWidth } } else { n.externalContainer = e("#" + n.options.zoomWindowPosition); n.externalContainerWidth = n.externalContainer.width(); n.externalContainerHeight = n.externalContainer.height(); n.externalContainerOffset = n.externalContainer.offset(); n.windowOffsetTop = n.externalContainerOffset.top; n.windowOffsetLeft = n.externalContainerOffset.left } n.isWindowSet = true; n.windowOffsetTop = n.windowOffsetTop + n.options.zoomWindowOffety; n.windowOffsetLeft = n.windowOffsetLeft + n.options.zoomWindowOffetx; n.zoomWindow.css({ top: n.windowOffsetTop }); n.zoomWindow.css({ left: n.windowOffsetLeft }); if (n.options.zoomType == "inner") { n.zoomWindow.css({ top: 0 }); n.zoomWindow.css({ left: 0 }) } n.windowLeftPos = String(((t.pageX - n.nzOffset.left) * n.widthRatio - n.zoomWindow.width() / 2) * -1); n.windowTopPos = String(((t.pageY - n.nzOffset.top) * n.heightRatio - n.zoomWindow.height() / 2) * -1); if (n.Etoppos) { n.windowTopPos = 0 } if (n.Eloppos) { n.windowLeftPos = 0 } if (n.Eboppos) { n.windowTopPos = (n.largeHeight / n.currentZoomLevel - n.zoomWindow.height()) * -1 } if (n.Eroppos) { n.windowLeftPos = (n.largeWidth / n.currentZoomLevel - n.zoomWindow.width()) * -1 } if (n.fullheight) { n.windowTopPos = 0 } if (n.fullwidth) { n.windowLeftPos = 0 } if (n.options.zoomType == "window" || n.options.zoomType == "inner") { if (n.zoomLock == 1) { if (n.widthRatio <= 1) { n.windowLeftPos = 0 } if (n.heightRatio <= 1) { n.windowTopPos = 0 } } if (n.largeHeight < n.options.zoomWindowHeight) { n.windowTopPos = 0 } if (n.largeWidth < n.options.zoomWindowWidth) { n.windowLeftPos = 0 } if (n.options.easing) { if (!n.xp) { n.xp = 0 } if (!n.yp) { n.yp = 0 } if (!n.loop) { n.loop = setInterval(function() { n.xp += (n.windowLeftPos - n.xp) / n.options.easingAmount; n.yp += (n.windowTopPos - n.yp) / n.options.easingAmount; if (n.scrollingLock) { clearInterval(n.loop); n.xp = n.windowLeftPos; n.yp = n.windowTopPos; n.xp = ((t.pageX - n.nzOffset.left) * n.widthRatio - n.zoomWindow.width() / 2) * -1; n.yp = ((t.pageY - n.nzOffset.top) * n.heightRatio - n.zoomWindow.height() / 2) * -1; if (n.changeBgSize) { if (n.nzHeight > n.nzWidth) { if (n.options.zoomType == "lens") { n.zoomLens.css({ "background-size": n.largeWidth / n.newvalueheight + "px " + n.largeHeight / n.newvalueheight + "px" }) } n.zoomWindow.css({ "background-size": n.largeWidth / n.newvalueheight + "px " + n.largeHeight / n.newvalueheight + "px" }) } else { if (n.options.zoomType != "lens") { n.zoomLens.css({ "background-size": n.largeWidth / n.newvaluewidth + "px " + n.largeHeight / n.newvalueheight + "px" }) } n.zoomWindow.css({ "background-size": n.largeWidth / n.newvaluewidth + "px " + n.largeHeight / n.newvaluewidth + "px" }) } n.changeBgSize = false } n.zoomWindow.css({ backgroundPosition: n.windowLeftPos + "px " + n.windowTopPos + "px" }); n.scrollingLock = false; n.loop = false } else { if (n.changeBgSize) { if (n.nzHeight > n.nzWidth) { if (n.options.zoomType == "lens") { n.zoomLens.css({ "background-size": n.largeWidth / n.newvalueheight + "px " + n.largeHeight / n.newvalueheight + "px" }) } n.zoomWindow.css({ "background-size": n.largeWidth / n.newvalueheight + "px " + n.largeHeight / n.newvalueheight + "px" }) } else { if (n.options.zoomType != "lens") { n.zoomLens.css({ "background-size": n.largeWidth / n.newvaluewidth + "px " + n.largeHeight / n.newvaluewidth + "px" }) } n.zoomWindow.css({ "background-size": n.largeWidth / n.newvaluewidth + "px " + n.largeHeight / n.newvaluewidth + "px" }) } n.changeBgSize = false } n.zoomWindow.css({ backgroundPosition: n.xp + "px " + n.yp + "px" }) } }, 16) } } else { if (n.changeBgSize) { if (n.nzHeight > n.nzWidth) { if (n.options.zoomType == "lens") { n.zoomLens.css({ "background-size": n.largeWidth / n.newvalueheight + "px " + n.largeHeight / n.newvalueheight + "px" }) } n.zoomWindow.css({ "background-size": n.largeWidth / n.newvalueheight + "px " + n.largeHeight / n.newvalueheight + "px" }) } else { if (n.options.zoomType == "lens") { n.zoomLens.css({ "background-size": n.largeWidth / n.newvaluewidth + "px " + n.largeHeight / n.newvaluewidth + "px" }) } if (n.largeHeight / n.newvaluewidth < n.options.zoomWindowHeight) { n.zoomWindow.css({ "background-size": n.largeWidth / n.newvaluewidth + "px " + n.largeHeight / n.newvaluewidth + "px" }) } else { n.zoomWindow.css({ "background-size": n.largeWidth / n.newvalueheight + "px " + n.largeHeight / n.newvalueheight + "px" }) } } n.changeBgSize = false } n.zoomWindow.css({ backgroundPosition: n.windowLeftPos + "px " + n.windowTopPos + "px" }) } } }, setTintPosition: function(e) { var t = this; t.nzOffset = t.$elem.offset(); t.tintpos = String((e.pageX - t.nzOffset.left - t.zoomLens.width() / 2) * -1); t.tintposy = String((e.pageY - t.nzOffset.top - t.zoomLens.height() / 2) * -1); if (t.Etoppos) { t.tintposy = 0 } if (t.Eloppos) { t.tintpos = 0 } if (t.Eboppos) { t.tintposy = (t.nzHeight - t.zoomLens.height() - t.options.lensBorderSize * 2) * -1 } if (t.Eroppos) { t.tintpos = (t.nzWidth - t.zoomLens.width() - t.options.lensBorderSize * 2) * -1 } if (t.options.tint) { if (t.fullheight) { t.tintposy = 0 } if (t.fullwidth) { t.tintpos = 0 } t.zoomTintImage.css({ left: t.tintpos + "px" }); t.zoomTintImage.css({ top: t.tintposy + "px" }) } }, swaptheimage: function(t, n) { var r = this; var i = new Image; if (r.options.loadingIcon) { r.spinner = e("<div style=\"background: url('" + r.options.loadingIcon + "') no-repeat center;height:" + r.nzHeight + "px;width:" + r.nzWidth + 'px;z-index: 2000;position: absolute; background-position: center center;"></div>'); r.$elem.after(r.spinner) } r.options.onImageSwap(r.$elem); i.onload = function() { r.largeWidth = i.width; r.largeHeight = i.height; r.zoomImage = n; r.zoomWindow.css({ "background-size": r.largeWidth + "px " + r.largeHeight + "px" }); r.zoomWindow.css({ "background-size": r.largeWidth + "px " + r.largeHeight + "px" }); r.swapAction(t, n); return }; i.src = n }, swapAction: function(t, n) { var r = this; var i = new Image; i.onload = function() { r.nzHeight = i.height; r.nzWidth = i.width; r.options.onImageSwapComplete(r.$elem); r.doneCallback(); return }; i.src = t; r.currentZoomLevel = r.options.zoomLevel; r.options.maxZoomLevel = false; if (r.options.zoomType == "lens") { r.zoomLens.css({ backgroundImage: "url('" + n + "')" }) } if (r.options.zoomType == "window") { r.zoomWindow.css({ backgroundImage: "url('" + n + "')" }) } if (r.options.zoomType == "inner") { r.zoomWindow.css({ backgroundImage: "url('" + n + "')" }) } r.currentImage = n; if (r.options.imageCrossfade) { var s = r.$elem; var o = s.clone(); r.$elem.attr("src", t); r.$elem.after(o); o.stop(true).fadeOut(r.options.imageCrossfade, function() { e(this).remove() }); r.$elem.width("auto").removeAttr("width"); r.$elem.height("auto").removeAttr("height"); s.fadeIn(r.options.imageCrossfade); if (r.options.tint) { var u = r.zoomTintImage; var a = u.clone(); r.zoomTintImage.attr("src", n); r.zoomTintImage.after(a); a.stop(true).fadeOut(r.options.imageCrossfade, function() { e(this).remove() }); u.fadeIn(r.options.imageCrossfade); r.zoomTint.css({ height: r.$elem.height() }); r.zoomTint.css({ width: r.$elem.width() }) } r.zoomContainer.css("height", r.$elem.height()); r.zoomContainer.css("width", r.$elem.width()); if (r.options.zoomType == "inner") { if (!r.options.constrainType) { r.zoomWrap.parent().css("height", r.$elem.height()); r.zoomWrap.parent().css("width", r.$elem.width()); r.zoomWindow.css("height", r.$elem.height()); r.zoomWindow.css("width", r.$elem.width()) } } if (r.options.imageCrossfade) { r.zoomWrap.css("height", r.$elem.height()); r.zoomWrap.css("width", r.$elem.width()) } } else { r.$elem.attr("src", t); if (r.options.tint) { r.zoomTintImage.attr("src", n); r.zoomTintImage.attr("height", r.$elem.height()); r.zoomTintImage.css({ height: r.$elem.height() }); r.zoomTint.css({ height: r.$elem.height() }) } r.zoomContainer.css("height", r.$elem.height()); r.zoomContainer.css("width", r.$elem.width()); if (r.options.imageCrossfade) { r.zoomWrap.css("height", r.$elem.height()); r.zoomWrap.css("width", r.$elem.width()) } } if (r.options.constrainType) { if (r.options.constrainType == "height") { r.zoomContainer.css("height", r.options.constrainSize); r.zoomContainer.css("width", "auto"); if (r.options.imageCrossfade) { r.zoomWrap.css("height", r.options.constrainSize); r.zoomWrap.css("width", "auto"); r.constwidth = r.zoomWrap.width() } else { r.$elem.css("height", r.options.constrainSize); r.$elem.css("width", "auto"); r.constwidth = r.$elem.width() } if (r.options.zoomType == "inner") { r.zoomWrap.parent().css("height", r.options.constrainSize); r.zoomWrap.parent().css("width", r.constwidth); r.zoomWindow.css("height", r.options.constrainSize); r.zoomWindow.css("width", r.constwidth) } if (r.options.tint) { r.tintContainer.css("height", r.options.constrainSize); r.tintContainer.css("width", r.constwidth); r.zoomTint.css("height", r.options.constrainSize); r.zoomTint.css("width", r.constwidth); r.zoomTintImage.css("height", r.options.constrainSize); r.zoomTintImage.css("width", r.constwidth) } } if (r.options.constrainType == "width") { r.zoomContainer.css("height", "auto"); r.zoomContainer.css("width", r.options.constrainSize); if (r.options.imageCrossfade) { r.zoomWrap.css("height", "auto"); r.zoomWrap.css("width", r.options.constrainSize); r.constheight = r.zoomWrap.height() } else { r.$elem.css("height", "auto"); r.$elem.css("width", r.options.constrainSize); r.constheight = r.$elem.height() } if (r.options.zoomType == "inner") { r.zoomWrap.parent().css("height", r.constheight); r.zoomWrap.parent().css("width", r.options.constrainSize); r.zoomWindow.css("height", r.constheight); r.zoomWindow.css("width", r.options.constrainSize) } if (r.options.tint) { r.tintContainer.css("height", r.constheight); r.tintContainer.css("width", r.options.constrainSize); r.zoomTint.css("height", r.constheight); r.zoomTint.css("width", r.options.constrainSize); r.zoomTintImage.css("height", r.constheight); r.zoomTintImage.css("width", r.options.constrainSize) } } } }, doneCallback: function() { var e = this; if (e.options.loadingIcon) { e.spinner.hide() } e.nzOffset = e.$elem.offset(); e.nzWidth = e.$elem.width(); e.nzHeight = e.$elem.height(); e.currentZoomLevel = e.options.zoomLevel; e.widthRatio = e.largeWidth / e.nzWidth; e.heightRatio = e.largeHeight / e.nzHeight; if (e.options.zoomType == "window") { if (e.nzHeight < e.options.zoomWindowWidth / e.widthRatio) { lensHeight = e.nzHeight } else { lensHeight = String(e.options.zoomWindowHeight / e.heightRatio) } if (e.options.zoomWindowWidth < e.options.zoomWindowWidth) { lensWidth = e.nzWidth } else { lensWidth = e.options.zoomWindowWidth / e.widthRatio } if (e.zoomLens) { e.zoomLens.css("width", lensWidth); e.zoomLens.css("height", lensHeight) } } }, getCurrentImage: function() { var e = this; return e.zoomImage }, getGalleryList: function() { var t = this; t.gallerylist = []; if (t.options.gallery) { e("#" + t.options.gallery + " a").each(function() { var n = ""; if (e(this).data("zoom-image")) { n = e(this).data("zoom-image") } else if (e(this).data("image")) { n = e(this).data("image") } if (n == t.zoomImage) { t.gallerylist.unshift({ href: "" + n + "", title: e(this).find("img").attr("title") }) } else { t.gallerylist.push({ href: "" + n + "", title: e(this).find("img").attr("title") }) } }) } else { t.gallerylist.push({ href: "" + t.zoomImage + "", title: e(this).find("img").attr("title") }) } return t.gallerylist }, changeZoomLevel: function(e) { var t = this; t.scrollingLock = true; t.newvalue = parseFloat(e).toFixed(2); newvalue = parseFloat(e).toFixed(2); maxheightnewvalue = t.largeHeight / (t.options.zoomWindowHeight / t.nzHeight * t.nzHeight); maxwidthtnewvalue = t.largeWidth / (t.options.zoomWindowWidth / t.nzWidth * t.nzWidth); if (t.options.zoomType != "inner") { if (maxheightnewvalue <= newvalue) { t.heightRatio = t.largeHeight / maxheightnewvalue / t.nzHeight; t.newvalueheight = maxheightnewvalue; t.fullheight = true } else { t.heightRatio = t.largeHeight / newvalue / t.nzHeight; t.newvalueheight = newvalue; t.fullheight = false } if (maxwidthtnewvalue <= newvalue) { t.widthRatio = t.largeWidth / maxwidthtnewvalue / t.nzWidth; t.newvaluewidth = maxwidthtnewvalue; t.fullwidth = true } else { t.widthRatio = t.largeWidth / newvalue / t.nzWidth; t.newvaluewidth = newvalue; t.fullwidth = false } if (t.options.zoomType == "lens") { if (maxheightnewvalue <= newvalue) { t.fullwidth = true; t.newvaluewidth = maxheightnewvalue } else { t.widthRatio = t.largeWidth / newvalue / t.nzWidth; t.newvaluewidth = newvalue; t.fullwidth = false } } } if (t.options.zoomType == "inner") { maxheightnewvalue = parseFloat(t.largeHeight / t.nzHeight).toFixed(2); maxwidthtnewvalue = parseFloat(t.largeWidth / t.nzWidth).toFixed(2); if (newvalue > maxheightnewvalue) { newvalue = maxheightnewvalue } if (newvalue > maxwidthtnewvalue) { newvalue = maxwidthtnewvalue } if (maxheightnewvalue <= newvalue) { t.heightRatio = t.largeHeight / newvalue / t.nzHeight; if (newvalue > maxheightnewvalue) { t.newvalueheight = maxheightnewvalue } else { t.newvalueheight = newvalue } t.fullheight = true } else { t.heightRatio = t.largeHeight / newvalue / t.nzHeight; if (newvalue > maxheightnewvalue) { t.newvalueheight = maxheightnewvalue } else { t.newvalueheight = newvalue } t.fullheight = false } if (maxwidthtnewvalue <= newvalue) { t.widthRatio = t.largeWidth / newvalue / t.nzWidth; if (newvalue > maxwidthtnewvalue) { t.newvaluewidth = maxwidthtnewvalue } else { t.newvaluewidth = newvalue } t.fullwidth = true } else { t.widthRatio = t.largeWidth / newvalue / t.nzWidth; t.newvaluewidth = newvalue; t.fullwidth = false } } scrcontinue = false; if (t.options.zoomType == "inner") { if (t.nzWidth > t.nzHeight) { if (t.newvaluewidth <= maxwidthtnewvalue) { scrcontinue = true } else { scrcontinue = false; t.fullheight = true; t.fullwidth = true } } if (t.nzHeight > t.nzWidth) { if (t.newvaluewidth <= maxwidthtnewvalue) { scrcontinue = true } else { scrcontinue = false; t.fullheight = true; t.fullwidth = true } } } if (t.options.zoomType != "inner") { scrcontinue = true } if (scrcontinue) { t.zoomLock = 0; t.changeZoom = true; if (t.options.zoomWindowHeight / t.heightRatio <= t.nzHeight) { t.currentZoomLevel = t.newvalueheight; if (t.options.zoomType != "lens" && t.options.zoomType != "inner") { t.changeBgSize = true; t.zoomLens.css({ height: String(t.options.zoomWindowHeight / t.heightRatio) + "px" }) } if (t.options.zoomType == "lens" || t.options.zoomType == "inner") { t.changeBgSize = true } } if (t.options.zoomWindowWidth / t.widthRatio <= t.nzWidth) { if (t.options.zoomType != "inner") { if (t.newvaluewidth > t.newvalueheight) { t.currentZoomLevel = t.newvaluewidth } } if (t.options.zoomType != "lens" && t.options.zoomType != "inner") { t.changeBgSize = true; t.zoomLens.css({ width: String(t.options.zoomWindowWidth / t.widthRatio) + "px" }) } if (t.options.zoomType == "lens" || t.options.zoomType == "inner") { t.changeBgSize = true } } if (t.options.zoomType == "inner") { t.changeBgSize = true; if (t.nzWidth > t.nzHeight) { t.currentZoomLevel = t.newvaluewidth } if (t.nzHeight > t.nzWidth) { t.currentZoomLevel = t.newvaluewidth } } } t.setPosition(t.currentLoc) }, closeAll: function() { if (self.zoomWindow) { self.zoomWindow.hide() } if (self.zoomLens) { self.zoomLens.hide() } if (self.zoomTint) { self.zoomTint.hide() } }, changeState: function(e) { var t = this; if (e == "enable") { t.options.zoomEnabled = true } if (e == "disable") { t.options.zoomEnabled = false } } }; e.fn.elevateZoom = function(t) { return this.each(function() { var n = Object.create(i); n.init(t, this); e.data(this, "elevateZoom", n) }) }; e.fn.elevateZoom.options = { zoomActivation: "hover", zoomEnabled: true, preloading: 1, zoomLevel: 1, scrollZoom: true, scrollZoomIncrement: .1, minZoomLevel: false, maxZoomLevel: false, easing: false, easingAmount: 12, lensSize: 150, zoomWindowWidth: 400, zoomWindowHeight: 400, zoomWindowOffetx: 0, zoomWindowOffety: 0, zoomWindowPosition: 1, zoomWindowBgColour: "#fff", lensFadeIn: false, lensFadeOut: false, debug: false, zoomWindowFadeIn: false, zoomWindowFadeOut: false, zoomWindowAlwaysShow: false, zoomTintFadeIn: false, zoomTintFadeOut: false, borderSize: 4, showLens: true, borderColour: "#888", lensBorderSize: 1, lensBorderColour: "#000", lensShape: "square", zoomType: "window", containLensZoom: true, lensColour: "white", lensOpacity: .4, lenszoom: false, tint: false, tintColour: "#333", tintOpacity: .4, gallery: false, galleryActiveClass: "zoomGalleryActive", imageCrossfade: false, constrainType: false, constrainSize: false, loadingIcon: false, cursor: "default", responsive: true, onComplete: e.noop, onZoomedImageLoaded: function() {}, onImageSwap: e.noop, onImageSwapComplete: e.noop, zoomImage: "" } })(jQuery, window, document)
-----------------------------------------------------------------------------------------------------------------------
CLOUD ZOOM ELEVATE EFFECT
https://www.google.com/search?q=image+zoom+jquery&rlz=1C1CHBF_enGB882GB882&sxsrf=ALeKk00mC-B74HCFvQopqpt2DejnfFnWig:1592611867552&source=lnms&tbm=isch&sa=X&ved=2ahUKEwi-noXFjY_qAhXZVRUIHRssAfIQ_AUoAXoECAwQAw&biw=1366&bih=576
----------------------------------------------------------------------------------------------------------------------
<html lang="en"> <head> https://www.sitepoint.com/5-jquery-web-page-zoom-plugins/ <title>Cloud Zoom Example: Responsive website</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, maximum-scale=1.0"> <!-- Include jQuery --> <script type="text/javascript" src="http://www.starplugins.com/sites/starplugins/js/jquery.js"></script> <!-- Various page styles. --> <style type="text/css"> body { font-family: arial, sans-serif; color: #444; font-size: 16px; padding:0px; margin:0px; } p { line-height: 20px; } code { font-weight: bold; color: #f44;; } a { color:#3d8dde; } #wrapper { padding:10px; } </style> <!-- Include Cloud Zoom JavaScript --> <script type="text/javascript" src="http://www.starplugins.com/sites/starplugins/js/cloudzoom/cloudzoom.js"></script> <!-- Include Thumbelina JavaScript --> <script type="text/javascript" src="http://www.starplugins.com/sites/starplugins/js/thumbelina/thumbelina.js"></script> <!-- Include Cloud Zoom CSS --> <link href="http://www.starplugins.com/sites/starplugins/js/cloudzoom/cloudzoom.css" type="text/css" rel="stylesheet" /> <!-- Include Thumbelina CSS --> <link href="http://www.starplugins.com/sites/starplugins/js/thumbelina/thumbelina.css" type="text/css" rel="stylesheet" /> <script type = "text/javascript"> CloudZoom.quickStart(); // Initialize the slider. $(function(){ $('#slider1').Thumbelina({ $bwdBut:$('#slider1 .left'), $fwdBut:$('#slider1 .right') }); }); </script> <style> /* div that surrounds Cloud Zoom image and content slider. */ #surround { width:50%; min-width: 256px; max-width: 480px; } /* Image expands to width of surround */ img.cloudzoom { width:100%; } /* CSS for slider - will expand to width of surround */ #slider1 { margin-left:20px; margin-right:20px; height:119px; border-top:1px solid #aaa; border-bottom:1px solid #aaa; position:relative; } </style> <script type="text/javascript"> // The following piece of code can be ignored. $(function(){ $(window).resize(function() { $('#info').text("Page width: "+$(this).width()); }); $(window).trigger('resize'); }); // The following piece of code can be ignored. if (window.location.hostname.indexOf("starplugins.") != -1) { var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-254857-7']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); } </script> </head> <body> <div id="wrapper"> <h1>Cloud Zoom (V3.1) Example: Use with Thumbelina content slider</h1> <p>This page demonstrates how to use the free Thumbelina content slider with Cloud Zoom.</p> <div id="surround"> <img class="cloudzoom" alt ="Cloud Zoom small image" id ="zoom1" src="http://www.starplugins.com/sites/starplugins/images/jetzoom/large/image1.jpg" data-cloudzoom=' zoomSizeMode:"image", autoInside: 550 '> <div id="slider1"> <div class="thumbelina-but horiz left">˂</div> <ul> <li><img class='cloudzoom-gallery' src="http://www.starplugins.com/sites/starplugins/images/jetzoom/size81/image1.jpg" data-cloudzoom ="useZoom:'.cloudzoom', image:'http://www.starplugins.com/sites/starplugins/images/jetzoom/large/image1.jpg' "></li> <li><img class='cloudzoom-gallery' src="http://www.starplugins.com/sites/starplugins/images/jetzoom/size81/image2.jpg" data-cloudzoom ="useZoom:'.cloudzoom', image:'http://www.starplugins.com/sites/starplugins/images/jetzoom/large/image2.jpg' "></li> <li><img class='cloudzoom-gallery' src="http://www.starplugins.com/sites/starplugins/images/jetzoom/size81/image3.jpg" data-cloudzoom ="useZoom:'.cloudzoom', image:'http://www.starplugins.com/sites/starplugins/images/jetzoom/large/image3.jpg' "></li> <li><img class='cloudzoom-gallery' src="http://www.starplugins.com/sites/starplugins/images/jetzoom/size81/image4.jpg" data-cloudzoom ="useZoom:'.cloudzoom', image:'http://www.starplugins.com/sites/starplugins/images/jetzoom/large/image4.jpg' "></li> <li><img class='cloudzoom-gallery' src="http://www.starplugins.com/sites/starplugins/images/jetzoom/size81/image5.jpg" data-cloudzoom ="useZoom:'.cloudzoom', image:'http://www.starplugins.com/sites/starplugins/images/jetzoom/large/image5.jpg' "></li> <li><img class='cloudzoom-gallery' src="http://www.starplugins.com/sites/starplugins/images/jetzoom/size81/image6.jpg" data-cloudzoom ="useZoom:'.cloudzoom', image:'http://www.starplugins.com/sites/starplugins/images/jetzoom/large/image6.jpg' "></li> </ul> <div class="thumbelina-but horiz right">˃</div> </div> </div> <p id="info">info</p> <p>©2015 <a href="http://www.starplugins.com">Star Plugins</a></p> </div> </body> </html>------------------------------------------------------------------------------------------------------------------------
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment