home & anchor

This commit is contained in:
2024-03-03 15:53:34 +01:00
parent 814340e2ac
commit 1118fcbda0
8 changed files with 652 additions and 15 deletions

View File

@@ -40,22 +40,22 @@
});
// /////////////////
//// ancre dans texte au click parragraphe correspondant arrive en dessous du header
// // /////////////////
// //// ancre dans texte au click parragraphe correspondant arrive en dessous du header
(function($, window) {
var adjustAnchor = function() {
var $anchor = $('#block-quartiers-de-demain-views-block-statics-block-1'),
fixedElementHeight = 350;
if ($anchor.length > 0) {
$('html, body').stop().animate({scrollTop: $anchor.offset().top - fixedElementHeight }, 0);
}
};
// (function($, window) {
// var adjustAnchor = function() {
// var $anchor = $('#block-quartiers-de-demain-views-block-statics-block-1'),
// fixedElementHeight = 350;
// if ($anchor.length > 0) {
// $('html, body').stop().animate({scrollTop: $anchor.offset().top - fixedElementHeight }, 0);
// }
// };
$(window).on('hashchange', function() {
adjustAnchor();
});
// $(window).on('hashchange', function() {
// adjustAnchor();
// });
})(jQuery, window);
// })(jQuery, window);