Skip to content

Commit

Permalink
Multi-touch zoom fix
Browse files Browse the repository at this point in the history
  • Loading branch information
makryl committed Jul 23, 2014
1 parent 2027f95 commit 42ef2a2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Hotkeys for next, previous and close buttons.
- Closing after viewing of all images.
- Preloading of next and previous images.
- Multi-touch zoom.
- Uses link's `href` or `data-href` attribute for large images.
- Fully customizable styles.
- Customizable bottom area.
Expand Down
13 changes: 10 additions & 3 deletions abigimage.jquery.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* http://aeqdev.com/tools/js/abigimage/
* v 1.2.7
* v 1.2.8
*
* Copyright © 2014 Maksim Krylosov <[email protected]>
*
Expand Down Expand Up @@ -167,6 +167,7 @@
minD,
vert,
touches,
multi,

slideTransition = false,
slideQueueFn = [null, null, null],
Expand All @@ -179,6 +180,7 @@
y = 0;
s = 1;
vert = null;
multi = false;
if (opts.imgCSS) {
img.css({zIndex: opts.imgCSS.zIndex});
}
Expand All @@ -202,6 +204,7 @@
img[0].addEventListener('touchstart', function(e) {
if (!opened) return;
if (e.touches.length > 1) {
multi = true;
k = dis(e);
img.css({zIndex: opts.prevBtnBoxCSS.zIndex});
} else {
Expand Down Expand Up @@ -262,8 +265,12 @@

if (!e.touches.length) {
if (s <= opts.zoomMin) {
if (dx >= -1 && dx <= 1 && dy >= -1 && dy <= 1) {
slideNext(true);
if (time <= 1 || (dx >= -1 && dx <= 1 && dy >= -1 && dy <= 1)) {
if (multi) {
slideAnimate(0, 0, 1);
} else {
slideNext(true);
}
} else {
if (vert) {
var ady = Math.abs(dy);
Expand Down
2 changes: 1 addition & 1 deletion abigimage.jquery.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "abigimage",
"version": "1.2.7",
"version": "1.2.8",
"title": "ABigImage - view big versions of images",
"author": {
"name": "Maksim Krylosov",
Expand Down
2 changes: 1 addition & 1 deletion abigimage.jquery.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ <h1>ABigImage</h1>

<p>ABigImage is jQuery plugin for viewing big versions of images.</p>

<p>Current version: <b>1.2.7</b> (2014-07-24).</p>
<p>Current version: <b>1.2.8</b> (2014-07-24).</p>



<div class="coll">
<ul>
<li><a href="abigimage.jquery.js">abigimage.jquery.js</a> (16.6Kb)</li>
<li><a href="abigimage.jquery.js">abigimage.jquery.js</a> (16.8Kb)</li>
<li><a href="abigimage.jquery.min.js">abigimage.jquery.min.js</a> (7.7Kb)</li>
<li>Project on <a href="https://github.com/Aequiternus/ABigImage">GitHub</a></li>
</ul>
Expand Down Expand Up @@ -108,6 +108,7 @@ <h2>Features</h2>
<li>Hotkeys for next, previous and close buttons.</li>
<li>Closing after viewing of all images.</li>
<li>Preloading of next and previous images.</li>
<li>Multi-touch zoom.</li>
<li>Uses link's <code>href</code> or <code>data-href</code> attribute for large images.</li>
<li>Fully customizable styles.</li>
<li>Customizable bottom area.</li>
Expand Down

0 comments on commit 42ef2a2

Please sign in to comment.