你如何防止在移动野生动物园的textarea页面滚动 [英] how do you prevent page scroll in textarea on mobile safari
问题描述
我正在尝试为游戏制作一个用于移动野生动物园的小笔记本应用程序,但到目前为止它似乎没有成功。我想阻止页面滚动,所以它没有橡皮筋,感觉像是一个webapp但我要使用这个:
I am trying to make a little note pad app for mobile safari for funzies but so far it doesn't seem to be working out. I want to prevent page scrolling so it doesn't have the rubberband and feel like a webapp but to do this I am using:
document.ontouchmove = function(e){
alert("calling prevent default");
e.preventDefault();
}
除了在textarea中看起来像ontouchmove永远不会被解雇所以这很好用页面滚动仍然发生。有没有人想出如何在文本区域中更改苹果的默认功能,或者想出一个没有苹果默认功能的文本区域的替代方案?
This works great except for in textarea where it looks like ontouchmove never gets fired so page scrolling still happens. Has anyone figured out how to change apple's default functionality in the text area or figured out an alternative to text area that doesn't have apple's default functionality?
推荐答案
目前似乎没有一个好的解决方案。我找到了一个正在努力解决这个问题的项目,人们已经在文本字段中隐藏了跨度的创意,但这对我来说仍然是非常错误的。
There does not appear to be a good solution at this time. I found a project that is struggling with this problem as well and folks have gotten creative with hidden spans over text fields but that is still pretty buggy for me.
http://code.google.com/p/iscroll-js/issues/详细信息?id = 24
我想这只是对移动游猎的限制,因为似乎没有一个很好的解决方案,我可以在这一次。
I guess this is just a limitation to mobile safari as there doesn't appear to be a good solution that I can find at this time.
这篇关于你如何防止在移动野生动物园的textarea页面滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!