Home >Backend Development >PHP Tutorial >javascript - How to solve the problem of input getting focus and soft keyboard blocking input in Apple 5
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?
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?
Actually, @三月狠狠 is the solution, you can also refer to the weui demo. . .
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.