Event Data

In SA5's pub/sub model, certain Actions benefit from data.

  • The class adder needs to know what class to add, remove or toggle

  • Video seeking needs a position to seek to

These are specified in the form of Action-specific attributes, such as;

sa-event-action-video-seek:pos = 80%

Where this is placed

In most cases it makes sense to put this on the Action element directly so that it is centrally controlled no matter what trigger was performed.

However in some cases, it makes more sense to place this on the Triggering element;

  • A button might choose to seek to the start of the video. A different button might seek to 20 sec into that same video

SA5 Events has this flexibility inherently.

In our example, this data attribute;

sa-event-action-video-seek:pos = 80%

It can be placed on the Event, alongside the sa-event-action-video-seek attribute.

Or it can be placed on the Triggering element.

Last updated

Was this helpful?