Skip to content

Commit

Permalink
Merge pull request #45 from lfalin/fix-sticky-header
Browse files Browse the repository at this point in the history
Fix sticky header jumpiness
  • Loading branch information
matcornic authored May 29, 2017
2 parents 9edc2e2 + c68dda1 commit bf4cf2e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 5 additions & 3 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -71,6 +72,7 @@
{{ if .Params.toc }}
{{ partial "toc.html" . }}
{{ end }}
</div>

</div>
{{ if $isChapter }}
Expand Down
5 changes: 4 additions & 1 deletion static/js/hugo-learn.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit bf4cf2e

Please sign in to comment.