简体   繁体   English

菜单链接在iPad上无法正常工作

[英]Menu link not working properly on iPad

I've got a "sticking to the top" menu in this website: 我在这个网站上有一个“坚持到顶部”菜单:

http://www.platform5.ch/~kda/ http://www.platform5.ch/~kda/

It works like a charm on desktop browsers, but on my iPad I realise that the menu links doesn't always work. 在桌面浏览器上,它的工作原理像一个超级按钮,但是在我的iPad上,我意识到菜单链接并不总是有效。 Sometimes I need to scroll the page just a little bit to make it work. 有时,我需要稍微滚动一下页面才能使其正常工作。

Can anyone help with fixing this issue? 谁能帮助您解决此问题?

屏幕截图

I discovered that this is a known bug in iOS. 我发现这是iOS中的已知错误。 Elements with position:fixed don't handle 'click' and 'touch' events really well. position:fixed元素不能很好地处理“单击”和“触摸”事件。

In fact, they don't detect these events after a "programmtical" scroll of the page. 实际上,在页面“编程”滚动后,它们不会检测到这些事件。 Only after a "manual" scroll do these elements react to clicks and touches (even a 1px scroll from the user). 只有在“手动”滚动之后,这些元素才会对单击和触摸做出反应(即使来自用户的1px滚动)。

I ended up giving up on the position:fixed and I use some JS to programmatically re-positioned the menu according the the scrollTop attribute of the window. 我最终放弃了position:fixed并使用一些JS根据窗口的scrollTop属性以编程方式重新放置了菜单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM