There is a script for smooth scrolling to the anchor, but after performing 0.2 ms some kind of jump appears on the screen, after which it turns to the anchor.
What could be the problem?
$(function() { if ($(window).scrollTop() >= "250") $("#ToTop").fadeIn("slow") $(window).scroll(function() { if ($(window).scrollTop() <= "250") $("#ToTop").fadeOut("slow") else $("#ToTop").fadeIn("slow") }); if ($(window).scrollTop() <= $(document).height() - "") $("#rentacar").fadeIn("slow") $(window).scroll(function() { if ($(window).scrollTop() >= $(document).height() - "") $("#rentacar").fadeOut("slow") else $("#rentacar").fadeIn("slow") }); $("#ToTop").click(function() { $("html,body").animate({ scrollTop: 0 }, "slow") }) $("#rentacar").click(function() { $("html,body").animate({ scrollTop: 1500 }, "slow") }) });