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

只有少部分Mac用户会出现点击展示的图片正确显示弹窗和toolbar,但是弹窗内没有图片,有遇到过这种情况的吗?可否给个排查的思路 #628

Open
baixjian opened this issue Mar 1, 2024 · 4 comments

Comments

@baixjian
Copy link

baixjian commented Mar 1, 2024

浏览器用Chrome Safair Edge 都是如此情况
Screenshots
image
image

import Viewer from 'viewerjs';

    const defaultBaseOption = {
        navbar: false,
        title: false,
        toolbar: {
            zoomIn: 4,
            zoomOut: 4,
            prev: 4,
            next: 4,
            reset: 4,
            oneToOne: 4
        }
    };
    document.querySelectorAll('.vp-doc img').forEach((item) => {

        item.onclick = () => {
            const viewer = new Viewer(item, {
                ...defaultBaseOption,
                ...option,
                hide(e) {
                    viewer.destroy();
                }
            });
            viewer.show();
        };
    });
`
@fengyuanchen
Copy link
Owner

建议关闭注销的 hide 钩子换成 hidden 钩子试试。

@Spectature
Copy link

windows也复现了,windows关闭动画效果后复现上出问题,打开动画效果后正常显示
image

@fengyuanchen
Copy link
Owner

@Spectature 禁用浏览器动画视觉效果后,需要同时通过设置 transition 选项为 false 告诉 Viewer.js 禁用过渡动画。

@luchaoqun123
Copy link

试试我的这个复现步骤。看下是不是你说的问题。
前置条件 写一个列表,每一行都有一列是数组,数组中都是不同数量的图片。
操作步骤 点击查看图片张数为N的查看,点击缩略图切换到n张.
此时没有什么问题,一切符合预期
关键步骤点击一个图片张数< N的行进行图片查看,此时就会出现缩略图能展示,但是大图不展示。看dom,能看到图片和正确的src,但是宽高都为0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants