How to setup and use the yOffset property of $anchorScroll in AngularJS

后端 未结 1 1605
攒了一身酷
攒了一身酷 2021-02-13 01:29

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.

相关标签:
1条回答
  • 2021-02-13 02:05

    There is an example that illustrates how to use yOffset at the bottom of the $anchorScroll documentation.

    // offset position by 100px down from the top
    $anchorScroll.yOffset = 100;
    

    This is the example plunker

    0 讨论(0)
提交回复
热议问题