简体   繁体   English

禁用iOS5.1 Webapp跳动而禁用滚动功能?

[英]Disable iOS5.1 Webapp bounce w/out disabling scrolling?

Can anyone please tell me how they accomplished disabling the "bounce" effect in safari on the iPhone without disabling scrolling completely? 谁能告诉我他们是如何在不完全禁用滚动的情况下在iPhone上禁用Safari的“弹跳”效果的? I've googled the crap out of this and i can't find a working solution. 我用谷歌搜索了这个废话,我找不到有效的解决方案。

i've tried the following: 我尝试了以下方法:

<script>
 function BlockMove(event) { event.preventDefault();}
</script>

-> this just completely disables scrolling ->这只是完全禁用滚动

i've also tried scrollFix.js, and i don't want to resort to using iScroll4 or any bloated JS library. 我也尝试过scrollFix.js,但我不想诉诸使用iScroll4或任何any肿的JS库。 I'm stubborn but there has to be a reliable easy way to fix this right? 我很固执,但必须有一种可靠的简便方法来解决此问题?

The only thing I can think of is you need to detect when to stop the bounce, so when you want to stop the bounce then disable scrolling. 我唯一能想到的就是您需要检测何时停止反弹,因此当您想停止反弹时,请禁用滚动。 For example - I am moving my finger down which actually moving the page content up, you need to detect if the page ha reached the top, if so then disable scrolling. 例如-我将手指向下移动实际上将页面内容向上移动,则需要检测页面是否到达顶部,如果是,则禁用滚动。 When you detect the touch is moving up which means the content is moving down then enable scrolling again unless you hit the bottom of the page. 当您检测到触摸在向上移动时,这意味着内容在向下移动,然后再次启用滚动功能,除非您单击页面底部。 I am assuming this is the bounce effect you are talking about. 我假设这是您正在谈论的反弹效果。 It's default behavior I don't think you need to get rid of it, unless your client wants it and will not change his/her mind 这是默认行为,我认为您无需摆脱它,除非您的客户想要它并且不会改变主意

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

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