在scrollTop以编程方式更改后固定定位按钮上的移动Safari错误...? [英] Mobile Safari bug on fixed positioned button after scrollTop programmatically changed...?

查看:126
本文介绍了在scrollTop以编程方式更改后固定定位按钮上的移动Safari错误...?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚做了一个网页但是Mobile Safari(iPhone和iPad iOS 5.0.1)中有一个错误,有两个按钮固定在右上角和右下角..

I'm just about done a webpage but there is one bug in Mobile Safari (iPhone and iPad iOS 5.0.1) with two buttons that are fixed to the upper and lower right corners..

按钮不会在文本框中单击提交后淡入,该文本框打开到页面的其余部分...在页面的其余部分加载并且按钮淡入后,您可以单击在他们中的任何一个上他们都工作...

The buttons are not faded in until after clicking submit on a textbox which opens up to the rest of the page... After the rest of the page is loaded and the buttons are faded in you can click on either of them and they both work...

然而,点击它们会导致程序化滚动,滚动完成后你就不能再点击任何一个按钮直到你用手指物理滚动页面,即使只是一个小像素滚动...

However, clicking them causes a programmatic scroll and after that scroll is complete you can no longer click on either of the buttons until you physically scroll the page with your finger even just a tiny one pixel scroll...

我注意到的是,在程序化滚动之后如果你点击稍微下方TOP按钮,你看到高亮,好像你点击BOTTOM按钮,并处理底部按钮的动作,这告诉我的错误是,当以编程方式滚动固定位置按钮仍然与页面的其余部分一起移动,并且在执行实际的触摸滚动之前不会返回到固定位置....

What I have noticed is that after the programmatic scrolling if you tap just slightly below the TOP button you see the highlight as if you were tapping the BOTTOM button and the action of the bottom button is processed, which tells me the bug is that when scrolling programmatically the fixed position button still moves with the rest of the page and doesn't go back to it's fixed position until an actual touch scroll is performed....

有没有人知道解决这个问题的方法..?

Does anyone know a way around this..?

我添加了一个弹出窗口,显示按下了哪个按钮以便你可以测试它,请记住在第一次按下向下按钮(有效)之后再次按下它,它将无法工作,但点击向上按钮下方,你会看到正在发生的向下按钮动作....

I've added a popup that shows which button was pressed so you can test it, remember after the first press of the down button (which works) trying pressing down again, it won't work, but click just below the up button and you'll see the down button actions happening....

http://www.tsdexter.com/ceos

感谢您的帮助。

托马斯

(如果你能指出我可以向Apple提交错误的地方也好,除非已经有了)

(also if you can point me to where I can submit a bug to Apple that'd be good too, unless one already has been)

编辑:只需点击任一提交箭头,你就不需要输入它默认的工资/薪水

just click either of the submit arrows, you don't need to enter a wage/salary it has defaults

编辑2:这是一个更简单的示例来显示相同​​的问题..

EDIT 2: Here is a simpler example to show the same issue..

http://www.tsdexter.com/MobileSafariFixedPosBug.html

编辑3:错误报告给Apple

EDIT 3: Bug reported to Apple

推荐答案

我通过添加一个101%的高div然后(几乎)立即删除它来解决它。

I got around it by adding a 101% high div then (almost) immediately removing it.

尝试:

<style>
.iosfix {
  height: 101%;
  overflow: hidden;
}
</style>

当你滚动时:

window.scrollTo(0, _NEW_SCROLLTOP_);
$('body').append($('<div></div>').addClass('iosfix'));
setTimeout(function() {
  $('.iosfix').remove();
}, 500);

它也适用于jQuery.scrollTo。

It also works with jQuery.scrollTo.

请参阅此处示例。

这篇关于在scrollTop以编程方式更改后固定定位按钮上的移动Safari错误...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆