Skip Navigation
EnumerationEnumeration

OnThisPageNavigation

The names and rules of the “On This Page” column that the page markup, the stylesheet and the page script share.

enum OnThisPageNavigation

Overview

Like swift-docc-render’s OnThisPageNav, the column highlights one item: the first item while the page is scrolled to the top, the last item once it is scrolled to the bottom, and otherwise the last item whose section heading has passed a line trackingLinePercentage percent down the window.

Without JavaScript, scroll-driven animations track this. Each section heading is the subject of a view timeline named by timeline(_:), whose scroll port starts at the tracking line (see headingRules(anchors:)). Each item of the list follows the timeline of its own heading (timelineProperty) and that of the next item’s heading (nextTimelineProperty), and is highlighted while its own heading has passed the line and the next one has not. Browsers without scroll-driven animations use the page script instead, or show the first item highlighted.

Topics