Scrolls the given element's viewport so the first rows of the element are visible for the user.
Many applications have a navigation bar fixed to the top or bottom, obstructing the view on an element.
You can make up.reveal()
aware of these fixed elements
so it can scroll the viewport far enough so the revealed element is fully visible.
To make up.reveal()
aware of fixed elements you can either:
up-fixed="top"
or up-fixed="bottom"
{ fixedTopSelectors }
or { fixedBottomSelectors }
When the the revealed element would be closer to the viewport's top edge than this value, Unpoly will scroll the viewport to the top.
Set to 0
to disable snapping.
Defaults to up.viewport.config.revealSnap
.
The scrolling element to scroll.
Defaults to the given element's viewport.
Whether to scroll the viewport so that the first element row aligns with the top edge of the viewport.
Defaults to up.viewport.config.revealTop
.
When set to 'instant'
, this will immediately scroll to the new position.
When set to 'smooth'
, this will scroll smoothly to the new position.
When set to 'auto'
, the behavior is determined by the CSS property
scroll-behavior
of the viewport element.
The desired padding between the revealed element and the closest viewport edge (in pixels).
Defaults to up.viewport.config.revealPadding
.
Whether to snap to the top of the viewport if the new scroll position after revealing the element is close to the top edge.
Defaults to up.viewport.config.revealSnap
.