手机弹出键盘 窗口改变事件

var winHeight = $(window).height();
$(window).resize(function () {
var thisHeight = $(this).height();
if (winHeight - thisHeight > 50) {
setTimeout(function () { window.scrollTo(0, document.body.scrollHeight); }, 300)  // 滚动条加载到底部;
} else {
//窗口发生改变(小),故此时键盘收起
//当软键盘收起,在此处操作
}
});

原文地址:https://www.cnblogs.com/sjd1118/p/8538989.html