suyan.github.io icon indicating copy to clipboard operation
suyan.github.io copied to clipboard

在iphone的safari中打开,状态栏和导航栏会一直存在

Open basicworld opened this issue 8 years ago • 4 comments

首先谢谢闫总的主题,非常漂亮 问题:在iphone的safari中打开,状态栏和导航栏会一直存在,而不会像普通的网页一样,当向下翻动页面的时候导航栏可以自动隐藏。我测试了原生的3-jekyll,也存在相同的问题 不知道这个可以怎么修改一下? 谢谢

basicworld avatar May 03 '17 12:05 basicworld

不知道有没有理解你的问题,我的问题是小屏(iphone)浏览器上导航栏不会默认收起。因为不太会js,所以就先临时workaround了: https://github.com/cherrot/cherrot.github.io/commit/1297da0edff1130d7d0783c94b5baf4e48b521a0

  // only remove open in small screen
  if($(window).width() <= 1024) {
    menu.add(sidebar).add(main).removeClass('open');
  }

cherrot avatar May 03 '17 13:05 cherrot

你说的导航栏问题是:刚进入首页的时候,默认显示文章列表,对么?我刚刚也解决了一下,用的你的关键代码(谢谢!),不过我检测了useragent: basicworld.github.io/commit/d792352

  // test if it is phone
  // if true then remove open
  var Agents = new Array("Android", "iPhone", "iPod");
  var userAgentInfo = navigator.userAgent; 
  for (var v = 0; v < Agents.length; v++) {  
    if (userAgentInfo.indexOf(Agents[v]) > 0) { 
      menu.add(sidebar).add(main).removeClass('open');
      break; 
    }  
  }

不过我的问题不是这个,而是:这个主题在浏览长网页时,safari的导航栏(有前进、后退、分享等按钮那一栏)、地址栏不能收起

试了下你的博客,也是这样的

basicworld avatar May 03 '17 15:05 basicworld

不用iphone不了解,不过我猜safari是在网页完全加载完后会自动收起导航栏? 如果是这样,那有些资源由于GFW所以一直超时,可能就会触发你的问题?(比如disqus评论、google的web fonts、gravatar头像等)

cherrot avatar May 03 '17 15:05 cherrot

越过GFW测的,我再折腾一下^_^

basicworld avatar May 03 '17 15:05 basicworld