移动端之uc浏览器的搜索栏遮挡页面顶部内容的坑

605 阅读1分钟

通过navigator.userAgent获取浏览器信息,然后设置空标签

<div id="UCshow" style="height:44px;display:none"></div>
if(/(UCBrowser)/gi.test(navigator.userAgent)){
  console.log('我是uc浏览器');
  var uc = document.getElementById('UCshow')
  uc.style.display = 'block';
}