Home  >  Article  >  Backend Development  >  javascript - How to solve the problem of input getting focus and soft keyboard blocking input in Apple 5

javascript - How to solve the problem of input getting focus and soft keyboard blocking input in Apple 5

WBOY
WBOYOriginal
2016-12-01 00:57:091190browse

Now I am encountering a problem that when the wap page gets focus on the iPhone 5 phone, it will block the input box. How to solve it?
javascript - How to solve the problem of input getting focus and soft keyboard blocking input in Apple 5

Reply content:

Now I am encountering a problem that when the wap page gets focus on the iPhone 5 phone, it will block the input box. How to solve it?
javascript - How to solve the problem of input getting focus and soft keyboard blocking input in Apple 5

Actually, @三月狠狠 is the solution, you can also refer to the weui demo. . .
javascript - How to solve the problem of input getting focus and soft keyboard blocking input in Apple 5

Why is it blocked? My personal guess is that you used percentages to write the positioning. If you want to write the positioning in percentages, don’t write 100% for the outermost html height. Use JS to give it the page height.

This is caused by position: fixed. Solution: Replace fixed with relative when getting focus

@马Crazy Don’t write in fixed format. It can be judged that moving the input box up when clicked is also a solution.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn