jQuery - smooth scrolling event

0 votes
159 views
added Apr 16, 2019 in jQuery by LC Marshal Captain (25,770 points)
edited Apr 17, 2019 by LC Marshal
$(".floating-bar a[href^='#']").click(function(e) {
    e.preventDefault();
    
    var position = $($(this).attr("href")).offset().top;

    $("body, html").animate({
    scrollTop: position
    } /* speed */ );
});
lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...