up.viewport.saveScroll([viewport], [options])
JavaScript function
Saves scroll positions for later restoration.
The scroll positions will be associated with the current URL.
They can later be restored by calling up.viewport.restoreScroll()
at the same URL, or by following a link with an [up-scroll="restore"]
attribute.
Unpoly automatically saves scroll positions before navigating.
Parameters
[viewport]
[options.location]
optional
The URL for which to save scroll positions.
If omitted, the given layer's location is used.
Type: string
[options.layer='current']
optional
The layer for which to save scroll positions.
If omitted, positions for the current layer will be saved.
Type: string