Scroll to div using JQuery Animate

Here is the small piece of code, which you can use
$("#scroll-btn").click(function (){
  $('html, body').animate({
    scrollTop: $(".area").offset().top
    }, 800);
  return false;
});

Comments

Popular posts from this blog

Interview Question on Ruby on Rails

Inserting and Moving elements inside Ruby Array