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. . . . . . . . . . . . . .
Tongzhun, I encountered this problem a long time ago, but I haven’t found a more complete answer
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. . . . . . . . . . . . . .
android can listen to resize events