Preloads this link before the user clicks it. When the link is clicked, the response will already be cached, making the interaction feel instant.
Unpoly will only preload links with safe methods. The [up-preload]
attribute
has no effect on unsafe links.
Links with the [up-preload]
attribute are always followed by Unpoly and will not make a full page load.
See preloading links for more details and examples.
<a href="/path" up-preload>Hover over me to preload my content</a>
Info
All attributes for
[up-follow]
may also be used.
When to preload this link.
When set to 'hover'
(the default), preloading will start when the user hovers
over this link for a while. On touch devices preloading will
begin when the user places her finger on the link. Also see preloading on hover.
When set to 'insert'
, preloading will start immediatedly when this
link is inserted into the DOM. Also see eagerly preloading on insertion.
When set to 'reveal'
, preloading will start when the link is scrolled
into the viewport. If the link is already visible when
inserted, preloading will start immediately. Also see preloading when a link becomes visible.
[up-preload="hover"]
, this requires the user to hover
for the given number of milliseconds before the link is preloaded.
Defaults to up.link.config.preloadDelay
.
With [up-preload=reveal]
, this enlarges the viewport by the given number of pixels before
computing the intersection.
A positive number will load the deferred content some pixels before it becomes visible.
A negative number will require the user to scroll some pixels into the element before it is loaded.