什么是屏幕键盘关闭的Mobile Safari事件? [英] What is the Mobile Safari event for the on-screen keyboard closing?

查看:114
本文介绍了什么是屏幕键盘关闭的Mobile Safari事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在屏幕键盘上随时运行 $('html,body')。animate({scrollTop:0},0); 在我的iPad网络应用程序中关闭。我已尝试使用 .blur(); 但如果用户直接从屏幕键盘上关注下一个或上一个字段,则会导致问题。

I'd like to run a $('html, body').animate({ scrollTop: 0 }, 0); anytime the on-screen keyboard is closed in my iPad web app. I've tried with .blur(); but that causes problems if the user focuses on the next or previous field directly from the on-screen keyboard.

关闭键盘会触发任何类型的事件吗?这对我来说是最稳定的路线。

Does closing the keyboard trigger an event of any sort? That would be the most stable route for me to go.

推荐答案

将事件切换为模糊(),它似乎工作了使用iPad更好,Playbook仍然做一些奇怪的事情。我不认为事件发生在Playbook上已经存在。

Switched the event to blur() and it seems to work a lot better with the iPad, Playbook still does some strange things. I don't think the event firing is quite there for the Playbook yet.

// Check for dirty inputs
$("form :input").blur(function()
{
    // FORCE THE PAGE BACK TO THE TOP   
    $('html, body').animate({ scrollTop: 0 }, 0);           
});

这篇关于什么是屏幕键盘关闭的Mobile Safari事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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