Mobile Safari bug on fixed positioned button after scrollTop programmatically changed…?

后端 未结 11 2213
别跟我提以往
别跟我提以往 2020-11-28 04:10

I\'m just about done a webpage but there is one bug in Mobile Safari (iPhone and iPad iOS 5.0.1) with two buttons that are fixed to the upper and lower right corners..

11条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-28 04:44

    Example code

    if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) {
        $(document).on('focus', 'input, textarea', function() {
            $('header').css({'position':'static'});
        });
        $(document).on('blur', 'input, textarea', function() {
            $('header').css({'position':'fixed'});
        });
    }
    

提交回复
热议问题