Scroll nella pagina con ancore e jQuery
Localscroll
Il codice รจ semplice e lineare:
$(document).on('click', 'a[href^="#"]', function (event) {
event.preventDefault();
$('html, body').animate({
scrollTop: ( $($.attr(this, 'href')).offset().top - 100 )
}, 500);
});
E dove a[href^="#"]
sono i link con ancore.
Last updated
Was this helpful?