All we need is an easy explanation of the problem, so here it is.
I use the
$anchorScroll-service in AngularJS. It works fine. But I have a fixed navigation bar at the top and the scrolling location goes always x-pixels to far.
Now in the
$anchorScroll documentation there is a property called
yOffset. According to the documentation it should fix my problem.
I don’t know how to use this yOffset-property however, because this specific part has no example.
How can I use the
yOffset-property of the
How to solve :
I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.
There is an example that illustrates how to use
yOffset at the bottom of the
// offset position by 100px down from the top $anchorScroll.yOffset = 100;
This is the example plunker
Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂