Skip to content

Events

Methods can be used to respond to events, both triggered by user interaction and from g-composer in its life cycle.

User events

You can capture all SVG events as click or mouseover with the g-on: directive and execute an associated method.

load event

The 'load' event is fired for g-composer when the component and each element are loaded, and before the template has been processed; therefore, you can change the template. This event is captured with $.addEventListener('load', ...).

render event

The 'render' event is fired when the template has been processed; therefore, you can change the render process result. This event is captured with $.addEventListener('render', ...).

Intersection

When the intersection-ratio attribute is set between 0 and 1:

  • the intersection.enter event is emitted when that proportion of the element is visible in the viewport.
  • the intersection.exit event is emitted when that proportion of the element is no longer visible in the viewport.

Released under the MIT License.