Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的 Phonegap 应用程序中,我有一个屏幕,如果用户在文本区域之外点击或单击,则键盘应该隐藏。我使用了该.blur(功能,但是通过这样做,屏幕会上升,并且用户无法看到顶部的应用程序栏(但屏幕本身不会移动)。
.blur(
调用 blur 后,尝试window.scrollTo(0,0).
window.scrollTo(0,0)
如果我没记错的话,您可能必须将其包装在 0ms setTimeout
$('#someInput').blur(); setTimeout(function(){ window.scrollTo(0, 0); }, 0);