浏览代码

Fixed bug with nav UI hiding on mobile

full-screen-logo-homepage
Said Achmiz 5 年前
父节点
当前提交
f346bff4d4
共有 2 个文件被更改,包括 5 次插入4 次删除
  1. 2
    1
      .htaccess
  2. 3
    3
      assets/js/script.js

+ 2
- 1
.htaccess 查看文件

AddCharset utf-8 .shtml .html .css .php .txt .js AddCharset utf-8 .shtml .html .css .php .txt .js


<filesMatch ".(css)$">
# Disable caching of CSS and JS (for testing only).
<filesMatch ".(css|js)$">
Header set Cache-Control "max-age=0, public" Header set Cache-Control "max-age=0, public"
</filesMatch> </filesMatch>



+ 3
- 3
assets/js/script.js 查看文件



// On desktop, show site nav UI when scrolling a full page up, or to the // On desktop, show site nav UI when scrolling a full page up, or to the
// the top of the page. // the top of the page.
// On mobile, show site nav UI translucent on ANY scroll up.
// On mobile, show site nav UI on ANY scroll up.
if (GW.mediaQueries.mobileNarrow.matches) { if (GW.mediaQueries.mobileNarrow.matches) {
if (GW.scrollState.unbrokenUpScrollDistance > 0)
if (GW.scrollState.unbrokenUpScrollDistance > 0 || GW.scrollState.lastScrollTop <= 0)
showSiteNavUI(); showSiteNavUI();
} else if ( GW.scrollState.unbrokenUpScrollDistance > window.innerHeight } else if ( GW.scrollState.unbrokenUpScrollDistance > window.innerHeight
|| GW.scrollState.lastScrollTop == 0) {
|| GW.scrollState.lastScrollTop == 0) {
showSiteNavUI(); showSiteNavUI();
} }
} }

正在加载...
取消
保存