Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
payalord committed Aug 3, 2017
2 parents 0f63809 + 1942945 commit 7dd0094
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
4 changes: 2 additions & 2 deletions dist/xzoom.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ <h3>Options</h3>
<tr>
<td class="green">bg</td>
<td>false</td>
<td>Zoom image output as background.</td>
<td>Zoom image output as background, works only when position is set to "lens".</td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 1 addition & 1 deletion doc/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Here is list of all possible options and their description:
| adaptiveReverse | false | Same as lensReverse, but only available when adaptive is true. |
| title | false | Output title/caption of the image, in the zoom output window. |
| titleClass | xzoom-caption | Class name for caption "div" container. |
| bg | false | Zoom image output as background. |
| bg | false | Zoom image output as background, works only when position is set to "lens". |

Options are case sensetive. And must be passed to xZoom as javascript object:
```javascript
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xzoom",
"version": "1.0.7",
"version": "1.0.8",
"contributors": [
"Azat Ahmedov <[email protected]> (https://payalord.github.io)",
"Elman Guseynov <[email protected]> (http://elman.pro)"
Expand Down
27 changes: 14 additions & 13 deletions src/xzoom.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!-----------------------------------------------------
* xZoom v1.0.7
* xZoom v1.0.8
* (c) 2013 by Azat Ahmedov & Elman Guseynov
* https://github.com/payalord
* https://dribbble.com/elmanvebs
Expand Down Expand Up @@ -55,7 +55,7 @@ if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){
var active, title = '', caption, caption_container;

//Adaptive properties
var wsw, wsh, osw, osh, tsw, tsh, oposition, reverse, smoothNormal;
var wsw, wsh, osw, osh, tsw, tsh, oposition, reverse;//, smoothNormal;

this.adaptive = function() {
if (osw == 0 || osh == 0) {
Expand Down Expand Up @@ -111,14 +111,14 @@ if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){
case 'top':
stop = moffset.top;
sleft = moffset.left;
mtop = stop - tsh;
mtop = stop - mh; //tsh;
mleft = sleft;
break;
case 'left':
stop = moffset.top;
sleft = moffset.left;
mtop = stop;
mleft = sleft - tsw;
mleft = sleft - mw; //tsw;
break;
case 'bottom':
stop = moffset.top;
Expand Down Expand Up @@ -197,7 +197,7 @@ if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){
var ih = mh * cc;
var iw = ih * iwh;
}
if (smoothNormal && flag) {
if (flag) {
//If smoothMove
u = x;
v = y;
Expand Down Expand Up @@ -329,14 +329,14 @@ if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){
case 'top':
stop = moffset.top;
sleft = moffset.left;
mtop = stop - sh;
mtop = stop - mh;
mleft = sleft;
break;
case 'left':
stop = moffset.top;
sleft = moffset.left;
mtop = stop;
mleft = sleft - sw;
mleft = sleft - mw;
break;
case 'bottom':
stop = moffset.top;
Expand Down Expand Up @@ -625,7 +625,7 @@ if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){
llv = lv = v = my;
xscale(mx, my);

if (smoothNormal && !current.options.bg) {flag = true; requestAnimFrame(loopZoom);}
if (current.options.smooth) {flag = true; requestAnimFrame(loopZoom);}

current.eventclick(source);
});
Expand Down Expand Up @@ -656,7 +656,7 @@ if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){
}

if (x < 0 || x > sw || y < 0 || y > sh) source.trigger('mouseleave');
if (smoothNormal && !current.options.bg) {
if (current.options.smooth) {
u = event.pageX;
v = event.pageY;
} else {
Expand Down Expand Up @@ -717,11 +717,11 @@ if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){
reverse = current.options.lensReverse && current.options.position == 'inside';

//Limits
if (current.options.smoothZoomMove < 0) current.options.smoothZoomMove = 0;
if (current.options.smoothLensMove < 0) current.options.smoothLensMove = 0;
if (current.options.smoothScale < 0) current.options.smoothScale = 0;
if (current.options.smoothZoomMove < 1) current.options.smoothZoomMove = 1;
if (current.options.smoothLensMove < 1) current.options.smoothLensMove = 1;
if (current.options.smoothScale < 1) current.options.smoothScale = 1;

smoothNormal = current.options.smoothZoomMove && current.options.smoothLensMove && current.options.smoothScale;
//smoothNormal = current.options.smoothZoomMove && current.options.smoothLensMove && current.options.smoothScale;

//Adaptive
if (current.options.adaptive) {
Expand Down Expand Up @@ -896,6 +896,7 @@ if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){
fadeIn: true,
fadeTrans: true,
fadeOut: false,
smooth: true,
smoothZoomMove: 3,
smoothLensMove: 1,
smoothScale: 6,
Expand Down

0 comments on commit 7dd0094

Please sign in to comment.