iOS 7 iPad Safari Landscape innerHeight/outerHeight layout issue

后端 未结 13 954

We\'re seeing issues with a web app that has a height of 100% on Safari in iOS 7. It appears that the window.innerHeight (672px) doesn\'t match window.outerHeight (692px), b

13条回答
  •  醉酒成梦
    2020-11-27 10:58

    In my case, the solution was to change positioning to fixed:

    @media (orientation:landscape) {
        html.ipad.ios7 > body {
            position: fixed;
            bottom: 0;
            width:100%;
            height: 672px !important;
        }
    }
    

    I also used a script to detect iPad with iOS 7:

    if (navigator.userAgent.match(/iPad;.*CPU.*OS 7_\d/i)) {
        $('html').addClass('ipad ios7');
    }
    

提交回复
热议问题