Dandi of FrontEndContento
1/31/2018 - 9:05 AM

Smooth page scrolling

Scroll page to a specific DOM element after x seconds

/*
  @params: 
    elem : target
    tTimeout : seconds to complete scrolling animation
*/
var scrollToY = function(elem, tTimeout){
  $('html, body').animate({
      scrollTop: $(".section-e"+elem).offset().top
  }, tTimeout);
};