0

I have anchor scrolling according to an id - as this -

function ($scope, $location, $anchorScroll) {
      $scope.gotoBottom = function() {
        // set the location.hash to the id of
        // the element you wish to scroll to.
        $location.hash('bottom');

        // call $anchorScroll()
        $anchorScroll();
      };

(taken from angularjs.org)

I have to set an offset for this $location.hash('bottom') due to a fixed header (common problem offsetting an html anchor to adjust for fixed header ) .

How to get that offset ?

Community
  • 1
  • 1
URL87
  • 10,667
  • 35
  • 107
  • 174

1 Answers1

0

Try This one

$anchorScroll.yOffset = 20;

Learner
  • 8,379
  • 7
  • 44
  • 82