From 9ec3ae384b443b7147944bfa5bb9081054adf113 Mon Sep 17 00:00:00 2001 From: Patrick Riemer Date: Tue, 3 Mar 2015 11:54:55 +0800 Subject: [PATCH 1/2] Zoom level adjustable via configuration. --- js/jquery.slideshowify.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/js/jquery.slideshowify.js b/js/jquery.slideshowify.js index 45641cc..882aec3 100644 --- a/js/jquery.slideshowify.js +++ b/js/jquery.slideshowify.js @@ -62,7 +62,9 @@ fadeInSpeed : 1500, fadeOutSpeed : 1500, aniSpeedMin : 9000, - aniSpeedMax : 15000 + aniSpeedMax : 15000, + minZoomLevel : 1, + maxZoomLevel : 1.2 }, _$viewEl, _$parentEl; @@ -120,11 +122,11 @@ // if marginThreshold is small, zoom a little instead of panning if (_transition && marginPixels < marginThreshold){ if (direction){ // zoom out - $img.css('scale','1.2'); - transAttr = {'scale':'1'}; + $img.css('scale',_cfg.maxZoomLevel); + transAttr = {'scale':_cfg.minZoomLevel}; } else { // zoom in - transAttr = {'scale':'1.2'}; + transAttr = {'scale':_cfg.maxZoomLevel}; } } From c0b79d79fc01633393c73627df6c6110426b348c Mon Sep 17 00:00:00 2001 From: Patrick Riemer Date: Tue, 3 Mar 2015 12:23:27 +0800 Subject: [PATCH 2/2] Added configuration to force zoom --- js/jquery.slideshowify.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/jquery.slideshowify.js b/js/jquery.slideshowify.js index 882aec3..b44b44f 100644 --- a/js/jquery.slideshowify.js +++ b/js/jquery.slideshowify.js @@ -64,7 +64,8 @@ aniSpeedMin : 9000, aniSpeedMax : 15000, minZoomLevel : 1, - maxZoomLevel : 1.2 + maxZoomLevel : 1.2, + alwaysZoom : false }, _$viewEl, _$parentEl; @@ -120,7 +121,7 @@ transAttr[modDims.attr] = modDims.sign + marginPixels + 'px'; // if marginThreshold is small, zoom a little instead of panning - if (_transition && marginPixels < marginThreshold){ + if (_cfg.alwaysZoom || (_transition && marginPixels < marginThreshold)){ if (direction){ // zoom out $img.css('scale',_cfg.maxZoomLevel); transAttr = {'scale':_cfg.minZoomLevel};