From 50a0d8b92858fa1217e9a85b156073b26a9d829f Mon Sep 17 00:00:00 2001 From: Andy Eades Date: Sun, 28 Jun 2015 22:23:56 +0100 Subject: [PATCH] bugfixes --- jquery.elevatezoom.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jquery.elevatezoom.js b/jquery.elevatezoom.js index cefa4a9..e62d962 100755 --- a/jquery.elevatezoom.js +++ b/jquery.elevatezoom.js @@ -448,6 +448,7 @@ if ( typeof Object.create !== 'function' ) { }).mouseleave(function(){ if(!self.scrollLock){ self.setElements("hide"); + self.options.onDestroy(self.$elem); } }); //end ove image @@ -610,11 +611,11 @@ if ( typeof Object.create !== 'function' ) { lensHeight = String((self.options.zoomWindowHeight/self.heightRatio)) } - if(self.options.zoomWindowWidth < self.options.zoomWindowWidth){ + if(self.nzWidth < self.options.zoomWindowHeight/self.heightRatio){ lensWidth = self.nzWidth; } else{ - lensWidth = (self.options.zoomWindowWidth/self.widthRatio); + lensWidth = String((self.options.zoomWindowWidth/self.widthRatio)); } self.zoomLens.css('width', lensWidth); @@ -1185,8 +1186,6 @@ if ( typeof Object.create !== 'function' ) { self.largeHeight = newImg.height; self.zoomImage = largeimage; self.zoomWindow.css({ "background-size": self.largeWidth + 'px ' + self.largeHeight + 'px' }); - - self.swapAction(smallimage, largeimage); return; } @@ -1782,9 +1781,10 @@ if ( typeof Object.create !== 'function' ) { cursor:"default", // user should set to what they want the cursor as, if they have set a click function responsive:true, onComplete: $.noop, + onDestroy: function() {}, onZoomedImageLoaded: function() {}, onImageSwap: $.noop, onImageSwapComplete: $.noop }; -})( jQuery, window, document ); +})( jQuery, window, document ); \ No newline at end of file