Understand the hash

Understand the hash
0

#1

Hi,
I stole this code from here to use with scrollSpy.
http://www.w3schools.com/bootstrap/bootstrap_ref_js_scrollspy.asp

  $(".navbar-collapse a").on('click', function(e) {
    event.preventDefault();
    if (this.hash !== "") {
      console.log(this.hash);
      //// Store hash (#)
      var hash = this.hash;
      $('html, body').animate({
        scrollTop: $(hash).offset().top
      }, 800, function(){
        window.location.hash = hash;
      }); 
    }
  });

I don’t understand this line, offset() is very obscur:

 scrollTop: $(hash).offset().top

Thanks


#2

EDIT: I understand now it take a coordonnies.