NbLayoutScrollService

Layout scroll service. Provides information about current scroll position, as well as methods to update position of the scroll.

The reason we added this service is that in Nebular there are two scroll modes:

  • the default mode when scroll is on body
  • and the withScroll mode, when scroll is removed from the body and moved to an element inside of the nb-layout component

Methods

NameDescription
getPosition()
returns:Observable<NbScrollPosition>

Returns scroll position

onScroll()
returns:Observable<any>

Returns a stream of scroll events

scrollTo()
parameters: x: number, y: number
returns:void

Sets scroll position

NbScrollPosition

Scroll position type

Properties

NameTypeDescription
xnumber

x - left

ynumber

y - top

JSThemesRegistry
Previous page
LayoutRulerService
Next page

Need some help or found an issue?

Ask on Stack Overflow with tag `nebular` or post an issue on GitHub.