mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-02-07 12:23:30 +00:00
Fix sticky header jumpiness (see: https://github.com/leafo/sticky-kit/wiki/Troubleshooting)
This commit is contained in:
parent
9edc2e2fef
commit
c68dda185e
2 changed files with 9 additions and 4 deletions
|
@ -27,8 +27,9 @@
|
||||||
<section id="body">
|
<section id="body">
|
||||||
<div id="overlay"></div>
|
<div id="overlay"></div>
|
||||||
|
|
||||||
<div class="padding highlightable">
|
<div class="padding highlightable sticky-parent">
|
||||||
|
|
||||||
|
<div class="sticky-spacer">
|
||||||
<div id="top-bar">
|
<div id="top-bar">
|
||||||
{{ if and .IsPage .Site.Params.editURL }}
|
{{ if and .IsPage .Site.Params.editURL }}
|
||||||
{{ $File := .File }}
|
{{ $File := .File }}
|
||||||
|
@ -71,6 +72,7 @@
|
||||||
{{ if .Params.toc }}
|
{{ if .Params.toc }}
|
||||||
{{ partial "toc.html" . }}
|
{{ partial "toc.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{{ if $isChapter }}
|
{{ if $isChapter }}
|
||||||
|
|
|
@ -56,7 +56,10 @@ images.each(function(index){
|
||||||
});
|
});
|
||||||
|
|
||||||
// Stick the top to the top of the screen when scrolling
|
// Stick the top to the top of the screen when scrolling
|
||||||
$("#top-bar").stick_in_parent({spacer: false});
|
$("#top-bar").stick_in_parent( {
|
||||||
|
parent: ".sticky-parent",
|
||||||
|
spacer: ".sticky-spacer",
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue