Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能否提几个改进建议 #1

Closed
349989153 opened this issue Oct 12, 2020 · 4 comments
Closed

能否提几个改进建议 #1

349989153 opened this issue Oct 12, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@349989153
Copy link

repo主做这个插件辛苦了,插件也很棒,已star。

下面想提几个改进建议,是我在使用过程中遇到的问题,反馈给您。

1、希望加个选项,可以选择插件滑动的方向。
我用的时候发现插件的滑动方向和我平常习惯的方向相反,在查看了代码后,我自己改成:
x: -getXY(e, 'x'), y: -getXY(e, 'y')
但是这样不够方便,还是希望能够通过选项控制,比如:

$('.container').mtfpicviewer({
        reverseDragDirection: true,
});
@349989153
Copy link
Author

2、希望能增加个选项,点击图片时只显示单张图片。

现在按照默认的设置,点击图片后显示的是所有图片,但业务需求只需要点哪张显示哪张,这个能否做个选项控制一下。

@349989153
Copy link
Author

3、滑动动画略卡,研究后发现是节流函数间隔设置得太长导致。我改成16,感觉好蛮多:

$picViewer.on('mousemove touchmove', throttle(function(e) {
                            movedDistance = onMovingPicViewer(e, start);
                        }, 16));

@mantoufan
Copy link
Owner

您的建议已更新,请下载1.0.1版,然后如下设置即可:

controls: {
       reverseDrag: {x: true, y: true},
       canChange: false
}
  • controls {对象} 控件参数 [设置查看器功能] 可选 1.0.1版本新增
    • reverseDrag {对象} 影像移动方向 与 滑动及拖拽方向 方向,默认 与Windows设备体验相同,反向后与 苹果设备 体验相同
      • x {布尔值} false(默认) | true 水平方向是否反向
      • y {布尔值} false(默认) | true 竖直方向是否反向
    • canChange {布尔值} true(默认) | false 是否允许切换

@mantoufan mantoufan pinned this issue Oct 12, 2020
@mantoufan mantoufan self-assigned this Oct 12, 2020
@mantoufan mantoufan added the enhancement New feature or request label Oct 12, 2020
@349989153
Copy link
Author

非常感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants