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

调用自动播放后再触发退出,遮罩层虽然变透明,但没有隐藏。挡在最顶层。 #367

Closed
Fazime opened this issue Feb 29, 2020 · 2 comments

Comments

@Fazime
Copy link

Fazime commented Feb 29, 2020

Describe the bug
调用自动播放后再触发退出,遮罩层虽然变透明,但没有隐藏。挡在最顶层。

为了实现自动播放。直接调用 $().viewer('show',true) 。之后点击关闭按钮或者遮罩退出,外层的 viewer-container 显示透明,但不隐藏,挡在最顶层,全页面无法点击。

To Reproduce
Steps to reproduce the behavior:

  1. $().viewer('show',true)
  2. 点击关闭按钮或者遮罩退出
  3. 外层的 viewer-container 显示透明,但不隐藏,挡在最顶层
  4. 全页面无法点击

Expected behavior
遮罩层能隐藏

Screenshots
image
image

Desktop (please complete the following information):

  • OS: win10, iOS 13
  • Browser chrome,safari

Smartphone (please complete the following information):

  • Device: all
@Fazime
Copy link
Author

Fazime commented Feb 29, 2020

//播放设置
let setting = storage('setting');
options.interval = setting && setting.auto_speed ? setting.auto_speed*1000 : 3000;
//VIEWER
pics.html(tpl).viewer(options).find('img').lazyload();
if (setting) {
if (setting.auto_show) {
pics.viewer('show',true);
if (setting.auto_play) pics.viewer('play');
} else if (setting.auto_play) {
pics.viewer('show',true).viewer('play');
}
}

@fengyuanchen
Copy link
Owner

You should call the hide method with its first parameter set to true too:

viewer.show(true);
viewer.hide(true);

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