如何安装和使用$ anchorScroll在AngularJS的yOffset财产财产、anchorScroll、AngularJS、yOffset

2023-09-13 04:40:25 作者:红桃丶Peach

我用AngularJS的 $ anchorScroll - 服务。它工作正常。但我有在顶部固定的导航栏和滚动位置的推移始终的X像素为止。

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.

现在在 $ anchorScroll 文件有一个叫做物业 yOffset 。根据文档应该解决我的问题。

Now in the $anchorScroll documentation there is a property called yOffset. According to the documentation it should fix my problem.

我不知道但是如何使用这个yOffset属性,因为这个特定部分没有例子。

I don't know how to use this yOffset-property however, because this specific part has no example.

我如何使用 yOffset 的-property的 $ anchorScroll -service?

How can I use the yOffset-property of the $anchorScroll-service?

推荐答案

有是演示了如何使用 yOffset $ anchorScroll 文档。

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;

这是例子 plunker

 
精彩推荐