@doggybootsy/dom-router
v1.0.7
Published
A simple way to transition to pages w/o reloading to it.
Readme
Simple dom router
Go between pages without reloading and be able to preserve some elements between pages
usage
importing
// CJS
require("@doggybootsy/dom-router");
// ESM
import "@doggybootsy/dom-router";dom
Reloading scripts
Elements in the head with the selector of head > script[data-router-reload] will we run the script when changing tabs.
Scrolling saving
Elements in the body with the selector of [data-router-scroll][id] will stay at the same section when scrolling like before changing tabs if the other node is found.
Preserve
Elements in the body with the selector of [data-router-preserve][id] will contain the same children and properties as before changing tabs if found.
Ignore links
Elements in the body with the selector of a[data-router-ignore] will ignore this a link and make act like before
