-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added
threshold
option to allow users select the % of link areas th…
…at entered the viewport before prefetching (#214)
- Loading branch information
Showing
4 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>Prefetch: Basic Usage</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" media="screen" href="main.css"> | ||
<style> | ||
ul { | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: space-evenly; | ||
} | ||
|
||
li { | ||
margin-bottom: 32px; | ||
} | ||
|
||
a { | ||
display: block; | ||
width: 400px; | ||
height: 600px; | ||
background: #ccc; | ||
text-align: center; | ||
} | ||
</style> | ||
<script src="https://polyfill.io/v3/polyfill.min.js?features=IntersectionObserver"></script> | ||
</head> | ||
|
||
<body> | ||
<ul> | ||
<li> | ||
<a href="1.html">Link 1</a> | ||
</li> | ||
<li> | ||
<a href="2.html">Link 2</a> | ||
</li> | ||
<li> | ||
<a href="3.html">Link 3</a> | ||
</li> | ||
<li> | ||
<a href="4.html">Link 4</a> | ||
</li> | ||
</ul> | ||
<script src="../dist/quicklink.umd.js"></script> | ||
<script> | ||
quicklink.listen({threshold: 0.5}); | ||
</script> | ||
</body> | ||
|
||
</html> |