Skip to content

Commit 464789c

Browse files
committed
开发完成
1 parent ae54c37 commit 464789c

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

demo/index.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,17 @@ <h1>Hello, this is an image viewer.</h1>
5959
},
6060
swipeLastLeft: function (imageViewer, distance) {
6161
console.log('swipeLastLeft', distance);
62-
if (distance > 50) {
63-
imageViewer.setImageOption(['images/4.jpg']);
64-
return true;
65-
}
62+
// if (distance > 50) {
63+
// imageViewer.setImageOption(['images/4.jpg']);
64+
// return true;
65+
// }
6666
},
6767
swipeFirstRight: function (imageViewer, distance) {
6868
console.log('swipeFirstRight', distance);
69-
if (distance > 30) {
70-
imageViewer.setImageOption(['images/5.jpg', 'images/6.jpg', 'images/7.jpg']);
71-
return true;
72-
}
69+
// if (distance > 30) {
70+
// imageViewer.setImageOption(['images/5.jpg', 'images/6.jpg', 'images/7.jpg']);
71+
// return true;
72+
// }
7373
}
7474
});
7575

dist/imageViewer.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/viewer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class Viewer {
144144
return this;
145145
}
146146

147-
calculate(a, b) {
147+
_calculate(a, b) {
148148
return a > 0 ? (a - b) : (a + b);
149149
}
150150

@@ -161,7 +161,7 @@ class Viewer {
161161
}
162162

163163
if (this.needResetX) {
164-
this.imageViewer._dealWithMoveAction({deltaX: this.calculate(this.currentPanelX, this.allowDistanceX)}, true);
164+
this.imageViewer._dealWithMoveAction({deltaX: this._calculate(this.currentPanelX, this.allowDistanceX)}, true);
165165
setScaleAndTranslateStyle(this.panelEl, this.scale, this.currentPanelX > 0 ? this.allowDistanceX : -this.allowDistanceX, this.currentPanelY);
166166
} else {
167167
this.imageViewer._dealWithMoveAction({deltaX: 0}, true);
@@ -175,7 +175,7 @@ class Viewer {
175175
if (this.realWidth <= this.width && this.realHeight <= this.height)return this;
176176
let needSwipe = false;
177177
if (this.needResetX) {
178-
needSwipe = this.imageViewer._dealWithMoveActionEnd({deltaX: this.calculate(this.currentPanelX, this.allowDistanceX)}, true);
178+
needSwipe = this.imageViewer._dealWithMoveActionEnd({deltaX: this._calculate(this.currentPanelX, this.allowDistanceX)}, true);
179179
}
180180
if (needSwipe) {
181181
this.init(this.displayIndex, true, null, false);

src/css/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.viewer-animation {
2-
transition: transform .4s;
2+
transition: transform .3s;
33
}
44

55
.image-viewer {

0 commit comments

Comments
 (0)