javascript - When the mobile phone clicks on the input, will the button be pushed up? Please solve it! ! !
伊谢尔伦
伊谢尔伦 2017-06-07 09:24:14
0
4
889

H5 page When the button uses position: fixed;bottom: 0;, clicking the input button will be pushed up

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(4)
黄舟

Theoretically: the input box is activated and the input method pops up. As a result, the visible area of ​​the browser becomes smaller (the window becomes smaller), so it is normal for fixed elements to be pushed up.

If you think this is a bug, you can not fix it; or: hide the button when the input box is activated.

阿神

This should be a problem with the input box

小葫芦

This is a normal phenomenon of fixed. Generally, my method is to use a jQuery method to control it;
As follows:

$(function(){
    //焦点时隐藏
    $("input").on("focus",function(){
        $(".submit").hide();
    });
    //失去焦点时显示
    $("input").on("blur",function(){
        $(".submit").show();
    });
})
刘奇

Normal phenomenon: You can reload the same page and do a little processing on it. Personal opinion: You can also display:none the element that will be pushed up when the input box gains focus, and then display:none when the input method is closed (or the input loses focus)

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!