stagetime

stagetime

Source:

stagetime - Show or hide DOM elements based on the local time.

Members

(static, constant) version

Semantic Version of the package.

Source:

Methods

(static) init(elopt, settingsopt) → {Element|Array.<Element>}

Source:

This function inspects the data-stagetime-after and data-stagetime-until attributes of the given element and then adds or removes the stagetime-on or stagetime-off classes appropriately.

This function will also schedule future checks in case the after or until times are in the future.

Parameters:
Name Type Attributes Description
el Element <optional>

Element to initialize. If missing, all elements with either a data-stagetime-after or data-stagetime-until attributes will be initialized.

settings Object <optional>

Override default settings.

Properties
Name Type Attributes Default Description
context Object <optional>
document

The context to search for nodes.

attr_after string <optional>

The attribute for time start.

attr_until string <optional>

The attribute for time end.

class_on string <optional>

The class when object should be shown.

class_off string <optional>

The class when object should be hidden.

Returns:

Returns the elements that were initialized.

Type
Element | Array.<Element>