图像滚动问题解决
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
dd3d738eed
commit
d30c9a5f3b
|
|
@ -190,10 +190,10 @@ export default {
|
||||||
const totalImages = this.imageInfo.total;
|
const totalImages = this.imageInfo.total;
|
||||||
|
|
||||||
// 手动实现循环逻辑
|
// 手动实现循环逻辑
|
||||||
if (currentImageIdIndex >= totalImages - 1) {
|
if (currentImageIdIndex >= totalImages - 1 && e.wheelDeltaY < 0) {
|
||||||
// 滚动到最后一张时跳回第一张
|
// 滚动到最后一张时跳回第一张
|
||||||
csUtils.jumpToSlice(viewport.element, { imageIndex: 0 });
|
csUtils.jumpToSlice(viewport.element, { imageIndex: 0 });
|
||||||
} else if (currentImageIdIndex <= 0) {
|
} else if (currentImageIdIndex <= 0 && e.wheelDeltaY > 0) {
|
||||||
// 滚动到第一张时跳回最后一张
|
// 滚动到第一张时跳回最后一张
|
||||||
csUtils.jumpToSlice(viewport.element, { imageIndex: totalImages - 1 });
|
csUtils.jumpToSlice(viewport.element, { imageIndex: totalImages - 1 });
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -188,10 +188,10 @@ export default {
|
||||||
const totalImages = this.imageInfo.total;
|
const totalImages = this.imageInfo.total;
|
||||||
|
|
||||||
// 手动实现循环逻辑
|
// 手动实现循环逻辑
|
||||||
if (currentImageIdIndex >= totalImages - 1) {
|
if (currentImageIdIndex >= totalImages - 1 && e.wheelDeltaY < 0) {
|
||||||
// 滚动到最后一张时跳回第一张
|
// 滚动到最后一张时跳回第一张
|
||||||
csUtils.jumpToSlice(viewport.element, { imageIndex: 0 });
|
csUtils.jumpToSlice(viewport.element, { imageIndex: 0 });
|
||||||
} else if (currentImageIdIndex <= 0) {
|
} else if (currentImageIdIndex <= 0 && e.wheelDeltaY > 0) {
|
||||||
// 滚动到第一张时跳回最后一张
|
// 滚动到第一张时跳回最后一张
|
||||||
csUtils.jumpToSlice(viewport.element, { imageIndex: totalImages - 1 });
|
csUtils.jumpToSlice(viewport.element, { imageIndex: totalImages - 1 });
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue