Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/jquery.ez-plus.js
  • Loading branch information
danfumarel committed Oct 25, 2016
2 parents 91ff962 + d31d3c4 commit eab151a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[jQuery ElevateZoom Plus Plugin](http://igorlino.github.io/elevatezoom-plus/)
================================
Current Version: 1.1.20
Current Version: 1.1.21

[EZ Plus](http://igorlino.github.io/elevatezoom-plus/) is an up-to-date jQuery image zoom plug-in based on [EZ](https://github.com/elevateweb/elevatezoom)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ez-plus",
"title": "EZ Plus",
"version": "1.1.20",
"version": "1.1.21",
"description": "A jQuery image zoom plug-in, with tints, easing and gallery integration.",
"keywords": [
"zoom",
Expand Down
26 changes: 19 additions & 7 deletions src/jquery.ez-plus.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

/*
* jQuery ezPlus 1.1.20
* jQuery ezPlus 1.1.21
* Demo's and documentation:
* http://igorlino.github.io/elevatezoom-plus/
*
Expand Down Expand Up @@ -170,7 +170,7 @@ if (typeof Object.create !== 'function') {
self.currentZoomLevel = self.options.zoomLevel;

//get offset of the non zoomed image
self.nzOffset = self.$elem.offset();
self.updateOffset(self);
//calculate the width ratio of the large/small image
self.widthRatio = (self.largeWidth / self.currentZoomLevel) / self.nzWidth;
self.heightRatio = (self.largeHeight / self.currentZoomLevel) / self.nzHeight;
Expand Down Expand Up @@ -211,7 +211,8 @@ if (typeof Object.create !== 'function') {
'background-position: 0px 0px;' +
'background-repeat: no-repeat;' +
'cursor:' + (self.options.cursor) + ';' +
'overflow: hidden;';
'overflow: hidden;' +
'zindex: ' + self.options.zIndex + ";";
}

//if inner zoom
Expand Down Expand Up @@ -633,7 +634,7 @@ if (typeof Object.create !== 'function') {
//this can be caused by other on page elements
self.nzHeight = self.$elem.height();
self.nzWidth = self.$elem.width();
self.nzOffset = self.$elem.offset();
self.updateOffset(self);

if (self.options.tint && self.options.zoomType !== 'inner') {
self.zoomTint.css({
Expand Down Expand Up @@ -1131,7 +1132,7 @@ if (typeof Object.create !== 'function') {
self.yp = 0;
}
var interval = 16;
if ($.isNumeric(parseInt(self.options.easing))) {
if (Number.isInteger(parseInt(self.options.easing))) {
interval = parseInt(self.options.easing);
}
//if loop not already started, then run it
Expand Down Expand Up @@ -1279,7 +1280,7 @@ if (typeof Object.create !== 'function') {
var self = this;
var zoomLensWidth = self.zoomLens.width();
var zoomLensHeight = self.zoomLens.height();
self.nzOffset = self.$elem.offset();
self.updateOffset(self);
self.tintpos = String(((e.pageX - self.nzOffset.left) - (zoomLensWidth / 2)) * (-1));
self.tintposy = String(((e.pageY - self.nzOffset.top) - zoomLensHeight / 2) * (-1));
if (self.Etoppos) {
Expand Down Expand Up @@ -1542,7 +1543,7 @@ if (typeof Object.create !== 'function') {
self.spinner.hide();
}

self.nzOffset = self.$elem.offset();
self.updateOffset(self);
self.nzWidth = self.$elem.width();
self.nzHeight = self.$elem.height();

Expand Down Expand Up @@ -1817,6 +1818,17 @@ if (typeof Object.create !== 'function') {
self.zoomTint.hide();
}
},
updateOffset: function (self) {
if (self.options.zoomContainerAppendTo != 'body') {
self.nzOffset = self.$elem.offset();
appendedPosition = $(self.options.zoomContainerAppendTo).offset();
self.nzOffset.top = self.$elem.offset().top - appendedPosition.top;
self.nzOffset.left = self.$elem.offset().left - appendedPosition.left;

} else {
self.nzOffset = self.$elem.offset();
}
},

changeState: function (value) {
var self = this;
Expand Down

0 comments on commit eab151a

Please sign in to comment.