Skip to content

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

Notifications You must be signed in to change notification settings

benobee/sqs-template

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

Watchers

Forks

Releases

No releases published

Packages

No packages published