mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-06-20 07:40:32 +00:00
theme: fix sticky header to remove horizontal scrollbar #82
HTML5 solution; sorry IE11
This commit is contained in:
parent
891ecac371
commit
3224bfb1a3
6 changed files with 59 additions and 339 deletions
static/js
|
@ -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){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue