theme: fix sticky header to remove horizontal scrollbar

HTML5 solution; sorry IE11
This commit is contained in:
Sören Weber 2021-09-23 21:25:45 +02:00
parent 891ecac371
commit 3224bfb1a3
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589
6 changed files with 59 additions and 339 deletions
static/js

View file

@ -188,7 +188,16 @@ images.each(function(index){
$(window).resize(function() {
setMenuHeight();
});
// for the sticky header
$(window).scroll(function() {
// add shadow when not in top position
if ($(this).scrollTop() == 0) {
$('#top-bar').removeClass("is-sticky");
}
else {
$('#top-bar').addClass("is-sticky");
}
});
// debouncing function from John Hann
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
(function($, sr) {
@ -495,9 +504,6 @@ jQuery(function() {
$(document).ready($.proxy(anchorScrolls, 'init'));
})(window.document, window.history, window.location);
// Stick the top to the top of the screen when scrolling
jQuery("#top-bar").sticky({topSpacing:0, zIndex: 1000});
// Add link button for every
var text, clip = new ClipboardJS('.anchor');
$("h1~h2,h1~h3,h1~h4,h1~h5,h1~h6").append(function(index, html){