implement improved version of go-to-top button with javascript requiring only one click
This commit is contained in:
@ -129,7 +129,7 @@
|
|||||||
<div class="wy-grid-for-nav">
|
<div class="wy-grid-for-nav">
|
||||||
{#- SIDE NAV, TOGGLES ON MOBILE #}
|
{#- SIDE NAV, TOGGLES ON MOBILE #}
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||||||
<div class="wy-side-scroll">
|
<div class="wy-side-scroll" id="lammps-navbar">
|
||||||
<div class="wy-side-nav-search" {% if theme_style_nav_header_background %} style="background: {{theme_style_nav_header_background}}" {% endif %}>
|
<div class="wy-side-nav-search" {% if theme_style_nav_header_background %} style="background: {{theme_style_nav_header_background}}" {% endif %}>
|
||||||
{%- block sidebartitle %}
|
{%- block sidebartitle %}
|
||||||
|
|
||||||
@ -173,15 +173,15 @@
|
|||||||
</div>
|
</div>
|
||||||
{%- endblock %}
|
{%- endblock %}
|
||||||
</div>
|
</div>
|
||||||
<!-- <div style="padding: 4px;">
|
<div style="position: fixed; bottom: 0px; width: 300px; height: 64px; padding: 4px; background-color: #272525; text-align: center">
|
||||||
<center>
|
<button onclick="JumpToTop()" class="fa fa-caret-up" style="color:white; background-color: #272525; border-style: none;" title="Go to top"> Go to top</button>
|
||||||
<a href="#sidebar-top-target"><img src="_static/up.png" alt="(Up)"/> Go to top</a>
|
|
||||||
</center>
|
|
||||||
</div>
|
</div>
|
||||||
-->
|
<script>
|
||||||
<div style="position: fixed; bottom: 0px; width: 300px; height: 64px; padding: 4px; background-color: #272525; text-align: center">
|
let navbar = document.getElementById("lammps-navbar");
|
||||||
<a href="#sidebar-top-target" class="fa fa-caret-up" style="color: white"> Go to top</a>
|
function JumpToTop() {
|
||||||
</div>
|
navbar.scrollTop = 0;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||||||
|
|||||||
Reference in New Issue
Block a user