Skip to content

Commit

Permalink
apply gumshoe from mmistakes
Browse files Browse the repository at this point in the history
More info in this PR mmistakes/minimal-mistakes#2082
  • Loading branch information
Luis Puerto committed Mar 12, 2019
1 parent 995db68 commit 5b3b3e4
Show file tree
Hide file tree
Showing 5 changed files with 1,145 additions and 13 deletions.
38 changes: 28 additions & 10 deletions assets/js/_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
$(document).ready(function() {
// Sticky footer
var bumpIt = function() {
$("body").css("margin-bottom", $(".page__footer").outerHeight(true));
};
$("body").css("margin-bottom", $(".page__footer").outerHeight(true));
};

bumpIt();
$(window).resize(jQuery.throttle(250, function() {
bumpIt();
}));
$(window).resize(
jQuery.throttle(250, function() {
bumpIt();
})
);

// FitVids init
$("#main").fitVids();
Expand Down Expand Up @@ -76,12 +78,28 @@ $(document).ready(function() {
anchors.add();
anchors.remove('.archive__item-title, .author__name, .nav__title');

// Init smooth scroll
// Smooth scrolling
var scroll = new SmoothScroll('a[href*="#"]', {
header: '.masthead',
offset: 30,
updateURL: true,
popstate: true,
offset: 20,
speed: 300
});

// Gumshoe scroll spy init
var spy = new Gumshoe("nav.toc a", {
// Active classes
navClass: "active", // applied to the nav list item
contentClass: "active", // applied to the content

// Nested navigation
nested: false, // if true, add classes to parents of active link
nestedClass: "active", // applied to the parent items

// Offset & reflow
offset: 20, // how far from the top of the page to activate a content area
reflow: true, // if true, listen for reflows

// Event support
events: true // if true, emit custom events
});

// // Smooth scrolling
Expand Down
4 changes: 2 additions & 2 deletions assets/js/main.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 5b3b3e4

Please sign in to comment.