Skip to content

Repository files navigation

Table of Contents

registerAPIControllers

events are bound to the controller when elements are found within the DOM.

Controller

Bind events to active DOM elements through publish / subscribe

elementIsActive

Tests whether the node is active in the DOM

Parameters

Returns HTMLElement DOM Node

watch

emit event when the DOM element is active

Parameters

  • array Array list of nodes

findOne

returns only one element

Parameters

  • query String the dom selector

Returns HTMLElement

find

returns an a node list of all available elements

Parameters

  • query String the dom selector

Returns NodeList

api

Examples

controller.on("navbar", (el) => {
  navbar.init();
});

About

Simple module template that subscribes to DOM elements via a controller. Useful within Squarespace sites.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages