$anchorScroll.yOffset

yOffset

numberfunction()jqLite

If set, specifies a vertical scroll-offset. This is often useful when there are fixed positioned elements at the top of the page, such as navbars, headers etc.

yOffset can be specified in various ways:

  • number: A fixed number of pixels to be used as offset.

  • function: A getter function called everytime $anchorScroll() is executed. Must return a number representing the offset (in pixels).

  • jqLite: A jqLite/jQuery element to be used for specifying the offset. The distance from the top of the page to the element's bottom will be used as offset.
    Note: The element will be taken into account only as long as its position is set to fixed. This option is useful, when dealing with responsive navbars/headers that adjust their height and/or positioning according to the viewport's size.


In order for yOffset to work properly, scrolling should take place on the document's root and not some child element.
doc_AngularJS
2016-03-29 16:10:03
Comments
Leave a Comment

Please login to continue.