Instruction set reference
HIPE_OP_TOGGLE_CLASS
Makes an element a member of the specified CSS class, or removes it if it is already a member.
- location: the element to apply a CSS class to, or remove the CSS class from.
- arg[0]: The name of a CSS class correponding to a CSS style rule you've created.
Notes
This instruction can be used in conjunction with predefined CSS style rules to modify the appearance and behaviour of an element quickly.
When assigning classes to location 0 (the body element), note that the body element is not initialised until the first piece of content is added to it. Applying a CSS class to the body before the document is initialised will produce undefined behaviour.
The webkit engine can occasionally be temperamental when toggling classes on the fly. The cause of this issue is yet to be ascertained.