锚链接在ipad上无法正常工作 [英] anchor links not working properly on ipad
问题描述
iPad上的固定元素存在问题。
您可以在此处查看我们的布局: http://cibology.edoardobiasini.it/
右边的位置:fixed
元素包含一个带有页面锚点链接的导航栏。
在桌面浏览器上我们没有问题,而在iPad上,第一次点击导航后内容不会滚动,除非您强行用手指滚动页面。
We have a problem with a fixed element on iPad.
You can check our layout here: http://cibology.edoardobiasini.it/
The position:fixed
element on the right contains a nav with anchor links to the page.
On desktop browsers we have no problems, while on iPad the content doesn't scroll after the first click on the nav, unless you force the page to scroll with the fingers.
有没有人有任何建议?
推荐答案
这是Apple的事情,的位置:fixed
我带来的唯一解决方案是我们将导航栏的位置更改为 absolute
并计算右上角的值该文件。当滚动停止时会发生这种情况变化:
It is the Apple thing with position:fixed
The only solution i came with is that we change the position of the navbar into absolute
and calculate the right top value of the document. This position change is happening when scrolling stops:
$("body").off("scroll", function(){
//here goes the code
})
因此,用户看不到差异,一旦滚动再次激活,该位置将被支持已修复
So, the user don't see the difference, and once the scroll is active again the position is backed to fixed
这篇关于锚链接在ipad上无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!