knuff v0.7.0
Knuff
pushstate
and popstate
-events, but without the “hassle”.
Getting started
Knuff is available via npm and yarn, but it's just as easy to download the script and including it in your document.
However you'd like to “install” the script, you'll need to add the [data-knuff]
-attribute to your anchors and anchor-like elements; the attribute's value should be a URL – or part of one – but if left empty, Knuff will try to find a [href]
-attribute. If neither of these attributes have values, Knuff will leave the element alone. Easy peasy! :sunglasses:
Older browsers
Knuff uses a few things introduced in later versions of ECMAScript, so if you're unsure of what may or may not be supported, I'd recommend using the script compiled by Babel. :v:
To-do
- Docs & demo
License
MIT Licensed. You're free to do pretty much whatever you'd like with Knuff. Enjoy! :blush: