hladké rolovanie css
html {
scroll-behavior: smooth;
}
/* No support in IE, or Safari
You can use this JS polyfill for those */
http://iamdustan.com/smoothscroll/
ako hladké rolovanie v JavaScripte
window.scrollTo({ top: 900, behavior: 'smooth' })
hladké rolovanie jQuery onclick
$("#button").click(function() {
$('html, body').animate({
scrollTop: $("#myDiv").offset().top
}, 2000);
});
jquery hladký scrool
('a[href*="#"]').on('click', function (e) {
e.preventDefault()
$('html, body').animate(
{
scrollTop: $($(this).attr('href')).offset().top,
},
500,
'linear'
)
})