Router

Router

new Router(options)

Source:

Create a router

Parameters:
Name Type Description
options Object
Properties
Name Type Description
routes String

an array of routes

rootNode HTMLElement

the root html element

navLinks Array

any array of anchors to update on transition

classes.match Object

The class applied to matching linkes

classes.root Object

The class applied to matching root link

classes.parent Object

The class applied to mathcing parent link

Members

(static) goTo

Source:

Methods

(static) lazyload() → {Router}

Source:

prefetch content on a service worker

Returns:
Type
Router

(static) mount() → {Router}

Source:

Called after instantiation, boots everything up

Returns:
Type
Router

(static) onClick(e, elm) → {void}

Source:

mouse click event, triggers a fetch

Parameters:
Name Type Description
e Object

event object

elm HTMLElement

the html element entered

Returns:
Type
void

(static) onMouseEnter(e, elm) → {void}

Source:

mouse enter event, triggers a fetch

Parameters:
Name Type Description
e Object

event object

elm HTMLElement

the html element entered

Returns:
Type
void