diff options
author | jesselau76 <jesselau76@gmail.com> | 2018-11-16 03:27:14 +0300 |
---|---|---|
committer | jesselau76 <jesselau76@gmail.com> | 2018-11-16 03:27:14 +0300 |
commit | 0a2baa16d4ee1a2d6efecb1d9fffa1b7468a7455 (patch) | |
tree | 544f600e34dcf7ae6e9bb4bb742acc970eb45ba1 | |
parent | a8330ecc92c92a9f048a04cca1296f371c3d12bb (diff) |
hide button on small device
-rw-r--r-- | layouts/partials/header.html | 5 | ||||
-rw-r--r-- | layouts/post/single.html | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 87003d4..48d84cf 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -20,7 +20,7 @@ {{ if .Site.Params.searchfunction }} <a href="javascript:void(0)" class="w3-bar-item w3-button w3-hover-green" title="Search" onclick="displaysearch()"><i class="fa fa-search"></i></a> {{ end }} - + <span class="w3-hide-small"> {{- range $name, $path := .Site.Params.social }} {{- if $path }} {{- $realName := slicestr $name 2 }} @@ -28,7 +28,8 @@ <a href="{{ $path | safeURL }}" class="w3-bar-item w3-button w3-hover-green"><i class="fa fa-{{ $realName }}"></i></a> {{- end }} {{- end }} - + + </span> </div> </div> diff --git a/layouts/post/single.html b/layouts/post/single.html index b7453e2..80e1278 100644 --- a/layouts/post/single.html +++ b/layouts/post/single.html @@ -2,7 +2,7 @@ <!-- TOC --> {{ if and (ge (len .TableOfContents) 100) (ne .Params.toc "false") }} - <div id="toc" class="w3-dropdown-hover"> + <div id="toc" class="w3-dropdown-hover w3-hide-small w3-hide-medium"> <button class="w3-button w3-teal w3-xlarge">☰</button> <div class="w3-dropdown-content w3-bar-block w3-border" style="right:0"> @@ -17,7 +17,7 @@ <!-- Back to top --> {{ if .Site.Params.backtotop }} - <div id="backtotop"> + <div id="backtotop" class="w3-hide-small w3-hide-medium"> <button onclick="topFunction()" class="w3-btn w3-red w3-large" style="width:160px">{{ T "backtotop"}} →</button> @@ -40,6 +40,7 @@ window.onscroll = function() {scrollFunction()}; function scrollFunction() { <!-- TOC --> {{ if and (ge (len .TableOfContents) 100) (ne .Params.toc "false") }} + if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) { document.getElementById("toc").style.display = "block"; } else { |