top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

In Angular.Js , What is use for $anchorScroll?

0 votes
401 views
In Angular.Js , What is use for $anchorScroll?
posted Feb 23, 2018 by Sidharth Malhotra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

When called, it scrolls to the element related to the specified hash or (if omitted) to the current value of $location.hash(), according to the rules specified in the HTML5 spec.

It also watches the $location.hash() and automatically scrolls to match any anchor whenever it changes. This can be disabled by calling $anchorScrollProvider.disableAutoScrolling().

Additionally, you can use its yOffset property to specify a vertical scroll-offset (either fixed or dynamic).

Example

$anchorScroll([hash]);
answer Feb 26, 2018 by Manish Tiwari
...