Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

jQuery - smooth scrolling event

0 votes
45 views
added Apr 16 in jQuery by LC Marshal Captain (22,730 points)
edited Apr 17 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 */ );
});

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...