~~~
var $link         = $(link);
var href          = $link.attr('href');
var offSetTop = $(href).offset().top;
~~~