From fd98f664778cf173a63e79b54ff21d18ec99e889 Mon Sep 17 00:00:00 2001 From: chankalan Date: Thu, 28 Jan 2021 10:45:02 +0100 Subject: [PATCH] sans smooth scroll pour le premier retour des ancres sans va-et-vient --- squelettes/javascript/script.js | 40 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/squelettes/javascript/script.js b/squelettes/javascript/script.js index bc475f4..f9622ba 100644 --- a/squelettes/javascript/script.js +++ b/squelettes/javascript/script.js @@ -55,26 +55,26 @@ $(function() { }); // smooth scroll - $('a[href^="#"], .js-scrollTo').on('click', function(e) { - if($(this).hasClass('js-noscroll')) { - return; - } - var hash = this.hash; - var $target = $(hash); - var offset = $target.offset(); - if(!offset) { - $target = $('a[name='+hash.replace(/#/,'')+']'); - offset = $target.offset(); - } - if(offset) { - e.preventDefault(); - var newPos = offset.top - 10; - $('html, body').stop().animate( - {'scrollTop': newPos}, 750, 'swing', function() { - window.location.hash = hash; - }); - } - }); +// $('a[href^="#"], .js-scrollTo').on('click', function(e) { +// if($(this).hasClass('js-noscroll')) { +// return; +// } +// var hash = this.hash; +// var $target = $(hash); +// var offset = $target.offset(); +// if(!offset) { +// $target = $('a[name='+hash.replace(/#/,'')+']'); +// offset = $target.offset(); +// } +// if(offset) { +// e.preventDefault(); +// var newPos = offset.top - 10; +// $('html, body').stop().animate( +// {'scrollTop': newPos}, 750, 'swing', function() { +// window.location.hash = hash; +// }); +// } +// }); // champ de recherche dans le menu $('.loupe > a').on('click', function(){