Class Adder Actions 🧪

Add, remove, or toggle a specific class on an element.

Problems;

Ideally we want to be able to attach multiple event-actions to a single element.

sa-action-class-data:test

Usage Notes

Add the appropriate attribute to add, remove, or toggle classes. Assign it to the Event name that will invoke this Action.

e.g. sa-action-class-add = ( event name )

Separately, define the class that is being manipulated;

e.g. sa-action-class-data = ( class name )

Attributes

These are the supported Action attributes;

Attribute

sa-action-class-add

Add a class to the element

See Data for how to specify the class

sa-action-class-remove

Remove a class from the element

See Data for how to specify the class

sa-action-class-toggle

Toggles the class on the element

See Data for how to specify the class

Data

sa-action-class-data = ( class name )

Specify the class name that will be added, removed, or toggled.

Future

Multiple Classes

Last updated

Was this helpful?