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

使用组件引入如何在固定框之间放大缩小 #325

Closed
xd15332538931 opened this issue Apr 15, 2024 · 4 comments
Closed

使用组件引入如何在固定框之间放大缩小 #325

xd15332538931 opened this issue Apr 15, 2024 · 4 comments

Comments

@xd15332538931
Copy link

我想咨询下 我设置了 inline: true, 固定一个宽高框 移动图片 图片不能全部移出固定的框 缩小图片的时候 根据条件 缩小到一定程度 就不能缩小了 具体怎么实现?

@xd15332538931
Copy link
Author

缩放图片

@mirari
Copy link
Owner

mirari commented Apr 15, 2024

需求可能无法完美满足,这需要viewerjs支持

目前只能监听缩放和移动事件,在操作完成后移动回屏幕或调整到最小大小
参考
https://fengyuanchen.github.io/viewerjs/examples/moving-range-limit.html
fengyuanchen/viewerjs#429

@xd15332538931
Copy link
Author

非常感谢 我还想问下 怎么让图片横向 或者纵向 充满整个预览框 我看原来的都左右都会存在margin 我如果修改样式 增加margin-left:0 !important 那么 图片就不能向左移动 左边margin始终都是0 怎么能让图片刚开始展示的时候 左右两边没有间距 充满这个预览框呢?

@mirari
Copy link
Owner

mirari commented Apr 15, 2024

目前viewerjs应该也没有原生的方法支持,你需要自己计算倍率,再用zoom方法调整图片尺寸

@mirari mirari closed this as completed Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants