如何安装和使用$ anchorScroll在AngularJS的yOffset财产 [英] How to setup and use the yOffset property of $anchorScroll in AngularJS

查看:496
本文介绍了如何安装和使用$ anchorScroll在AngularJS的yOffset财产的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用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

这篇关于如何安装和使用$ anchorScroll在AngularJS的yOffset财产的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆