Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
basicworld opened this issue May 3, 2017 · 4 comments
Open

Comments

@basicworld
Copy link

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

@cherrot
Copy link

cherrot commented May 3, 2017

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

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

@basicworld
Copy link
Author

你说的导航栏问题是:刚进入首页的时候,默认显示文章列表,对么?我刚刚也解决了一下,用的你的关键代码(谢谢!),不过我检测了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的导航栏(有前进、后退、分享等按钮那一栏)、地址栏不能收起

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

@cherrot
Copy link

cherrot commented May 3, 2017

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

@basicworld
Copy link
Author

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants