A beautifully animated local scroll or anchor jump is typical for the modern web. In this video I show you how to develop a corresponding script based on jQuery.
Here you can find the complete code for the local scroll with jQuery. Don't forget to use the full jQuery version for the animation and not only the slim version.
$( document ).ready(function() { $('.local-scroll').on('click', function(e){ e.preventDefault(); var href = $(this).attr('href'); var offsetTop = $( href ).offset().top; if( href == '#unser-program' ) { offsetTop = offsetTop - 150; } $('html, body').animate({ scrollTop: offsetTop }, 'slow'); }); });