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

汉堡目录点击事件的bug #98

Open
pdsuwwz opened this issue Apr 16, 2018 · 0 comments
Open

汉堡目录点击事件的bug #98

pdsuwwz opened this issue Apr 16, 2018 · 0 comments

Comments

@pdsuwwz
Copy link

pdsuwwz commented Apr 16, 2018

正常浏览器窗口大小浏览页面的情况下,缩小浏览器宽度,直到汉堡按钮出现,但此时无法点击汉堡按钮,原因是 main.js 文件中的判断是 window.innerWidth <= 770,这个效果是等待文档加载完毕后才有效的。也就是说如果用户一开始浏览的页面大小不足以显示汉堡按钮的话,此时此刻将浏览器宽度缩小后,汉堡按钮是没有点击事件的。
解决方案:可以在 js 中再判断一次,就是不论汉堡按钮是否出现,都为其添加点击事件。

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

1 participant