scroll stop sous header

This commit is contained in:
2024-03-07 15:45:38 +01:00
parent 1f8059afbd
commit 175c589c76
8 changed files with 44 additions and 551 deletions

View File

@@ -43,3 +43,23 @@
});
// /////////////////
//// ancre dans texte au click parragraphe correspondant arrive en dessous du header
(function($, window) {
var adjustAnchor = function() {
var $anchor = $('.sidebar_first_container'),
fixedElementHeight = 350;
if ($anchor.length > 0) {
$('html, body').stop().animate({scrollTop: $anchor.offset().top - fixedElementHeight }, 0);
}
};
$(window).on('hashchange', function() {
adjustAnchor();
});
})(jQuery, window);