2019-10-12 18:55:30 +02:00
|
|
|
// Documentation Nav Scroll
|
2019-11-07 20:13:49 +01:00
|
|
|
$(function() {
|
2019-10-12 18:55:30 +02:00
|
|
|
// Vars
|
|
|
|
var nav = $(".sl-c-list-navigation-wrapper");
|
|
|
|
var sticky = nav.offset();
|
|
|
|
|
|
|
|
// Added sticky class when window top is great than nav top
|
|
|
|
function stickyNav() {
|
2019-10-18 07:37:23 +02:00
|
|
|
if (nav.length > 0 && $(window).scrollTop() >= sticky.top) {
|
2019-10-12 18:55:30 +02:00
|
|
|
$(".sl-l-medium-holy-grail__body").addClass("sl-js-nav--is-sticky");
|
|
|
|
} else {
|
|
|
|
$(".sl-l-medium-holy-grail__body").removeClass("sl-js-nav--is-sticky");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// When scrolling the page, execute stickyNav
|
|
|
|
$(window).scroll(function() {
|
|
|
|
stickyNav();
|
|
|
|
});
|
|
|
|
|
|
|
|
return stickyNav();
|
2019-11-07 20:13:49 +01:00
|
|
|
});
|