Mobile Webkit reflow issue

后端 未结 6 673
盖世英雄少女心
盖世英雄少女心 2020-12-05 06:04

I\'ve been experiencing an issue in mobile versions of webkit (specifically Webkit 534.46 on iOS 5.1.1 as mobile Safari, and now Chrome for iOS) which doesn\'t happen on any

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-05 06:38

    Here's a variation of McKamey's workaround. It avoids reflowing twice, and may help with flickering (depending on your app):

    setTimeout(function(){
        document.body.style.borderBottom = 
            document.body.style.borderBottom === 'none' ? '1px solid white' : 'none';
    }, 0);
    

提交回复
热议问题