arro
v0.1.0
Published
left/right arrow keyboard shortcuts
Downloads
3
Maintainers
Readme
arro
left/right-arrow keyboard shortcuts for flipping through [rel="prev"]
and [rel="next"]
links using native JavaScript
Usage
Load arro.js via script
tag or via require('arro')
in your bundle. Specify [rel="prev"]
and [rel="next"]
URLs via either link[href]
in a[href]
tags.
link
example
<!DOCTYPE html>
<title>2.html</title>
<link rel="prev" href="1.html">
<link rel="next" href="3.html">
<h1>2</h1>
<script src="arro.js" async></script>
a
example
<!DOCTYPE html>
<title>2.html</title>
<h1>2</h1>
<nav>
<a rel="prev" href="1.html">Previous</a>
<a rel="next" href="3.html">Next</a>
</nav>
<script src="arro.js" async></script>
Demo
- Download or clone the repo
- Open test/index.html in a web browser
Compatibility
Works in all modern browsers
Fund
License
MIT