is the down arrow that closes the keyboard
Suddenly discovered that alert(keyCode)
This button has no code on android
How to deal with it
How to judge Closed
仅有的幸福2017-06-28 09:29:03
Tongzhun, I encountered this problem a long time ago, but I haven’t found a more complete answer
世界只因有你2017-06-28 09:29:03
When the user calls out the soft keyboard, the page will trigger the resize event, and the page size will become smaller. The height is only the original height minus the keyboard height, which is generally less than 500. At the same time, there are almost no screens on the market with the original height less than 500. Mobile phone, so after resize is triggered, it is judged that if document.body.clientHeight>500
, the soft keyboard is regarded as being closed
There should be compatibility issues. . . . . . . . . . . . . .
天蓬老师2017-06-28 09:29:03
android can listen to resize events
var winHeight= $(window).height();
$(window).resize(function(){
var thisHeight=$(this).height();
if(winHeight - thisHeight >50){
$('.form_scrollTxt').hide();
$('.form p').css('margin-bottom','2px')
}else{
$('.form_scrollTxt').show();
$('.form p').css('margin-bottom','13px')
}
});