mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-18 19:00:24 +00:00
Merge pull request #45 from lfalin/fix-sticky-header
Fix sticky header jumpiness
This commit is contained in:
commit
bf4cf2e60d
2 changed files with 9 additions and 4 deletions
|
@ -27,9 +27,10 @@
|
|||
<section id="body">
|
||||
<div id="overlay"></div>
|
||||
|
||||
<div class="padding highlightable">
|
||||
|
||||
<div id="top-bar">
|
||||
<div class="padding highlightable sticky-parent">
|
||||
|
||||
<div class="sticky-spacer">
|
||||
<div id="top-bar">
|
||||
{{ if and .IsPage .Site.Params.editURL }}
|
||||
{{ $File := .File }}
|
||||
{{ $Site := .Site }}
|
||||
|
@ -71,6 +72,7 @@
|
|||
{{ if .Params.toc }}
|
||||
{{ partial "toc.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{{ if $isChapter }}
|
||||
|
|
|
@ -56,7 +56,10 @@ images.each(function(index){
|
|||
});
|
||||
|
||||
// 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() {
|
||||
|
|
Loading…
Reference in a new issue