This repository has been archived on 2023-12-31. You can view files and clone it, but cannot push or open issues or pull requests.
meritkollen/html/assets/js/softscrollscript.js
Felix Schulze 026618e581 upload from server
uploaded all websites as they are on the server
2019-09-17 21:20:48 +02:00

14 lines
466 B
JavaScript

$(function() {
$('a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top
}, 999);
return false;
}
}
});
});