new Layout(layoutEl, options)
Class constructor.
Methods
-
constructNavFromDOM
- (instance) Construct the sidebar navigation from headings within the DOM.
-
highlightNavItems
- (instance) Enables navigation item highlighting based on scroll position.
Relies on heading ids and anchor href being the same.
-
getDataAttributes(layoutElement)
- (static) Get the data attributes from the layoutEl. If the layout is being set up
declaratively, this method is used to extract the data attributes from the DOM.
-
init(rootEl, opts)
- (static) Initialise layout component.
Properties
Links
new LinkedHeading(...)
Represents a linked heading.
Class constructor.
Links
Layout#navAnchors
Instance Property
Type
- Array.<HTMLAnchorElement>
Links
Layout#constructNavFromDOM
Instance Method
Construct the sidebar navigation from headings within the DOM.
Links
Layout#navAnchors
Instance Property
Type
- Array.<HTMLAnchorElement>
Links
Layout#highlightNavItems
Instance Method
Enables navigation item highlighting based on scroll position.
Relies on heading ids and anchor href being the same.
Returns
Links
Layout.getDataAttributes(layoutElement)
Static Method
Get the data attributes from the layoutEl. If the layout is being set up
declaratively, this method is used to extract the data attributes from the DOM.
Returns
-
Object.<string, any>
- - Options for configuring the layout
Links
Layout.init(rootEl, opts)
Static Method
Initialise layout component.
Returns
-
Layout | Array.<Layout>
- Returns either a single Layout instance or an array of Layout instances
Links
new Layout(layoutEl, options)
Class constructor.
Methods
-
constructNavFromDOM
- (instance) Construct the sidebar navigation from headings within the DOM.
-
highlightNavItems
- (instance) Enables navigation item highlighting based on scroll position.
Relies on heading ids and anchor href being the same.
-
getDataAttributes(layoutElement)
- (static) Get the data attributes from the layoutEl. If the layout is being set up
declaratively, this method is used to extract the data attributes from the DOM.
-
init(rootEl, opts)
- (static) Initialise layout component.
Properties
Links