var htmlScrollHeight;
$('.other-input input').on('focus', function () {
htmlScrollHeight = $(document).scrollTop();
});
$('.other-input input').on('blur', function () {
$('html,body').animate({scrollTop:htmlScrollHeight}, 100);
if (isAndroid) {
//这个是安卓操作系统
$(".pay-content").css('bottom','0');
}
});
本文介绍了一种使用jQuery实现的解决方案,当输入框获得焦点时保存当前页面滚动位置,并在失去焦点时平滑地恢复到之前的位置。此外,针对安卓操作系统,还提供了额外的样式调整。
1万+

被折叠的 条评论
为什么被折叠?



