There are no tracking or monitoring cookies on this site. There are only cookies used for documentation examples related to cookies.
Close

Processing...
This may take a few seconds.

Externally calling Active CSS actions

There are a few Active CSS actions that can be used outside of the core, in external functions.

If you need more, let us know or submit a patch for the core. You can inspect these commands in the github repo if you are interested in how they interface with the internal commands.

ActiveCSS.trigger

ActiveCSS.trigger(element / selector or custom event selector, event);

Eg.

el = document.getElementByID("myDiv");
ActiveCSS.trigger(el, "click");

or

ActiveCSS.trigger(".myDivs", "click");

or

ActiveCSS.trigger("~loginStart", "drawLoginBox");

See documentation on "trigger"

ActiveCSS.triggerReal

ActiveCSS.triggerReal(element or selector, event);

Eg.

el = document.getElementByID("myDiv");
ActiveCSS.triggerReal(el, "click");

or

ActiveCSS.triggerReal(".myDivs", "click");

Obviously you can't run trigger-real on anything that is not a real element on the page. Ie. you can't run trigger-real on custom event declarations and non-DOM and non-synthetic events. For example, it would be like asking the browser to to perform the DOM "cheese" event on the element "~giveMeMyFood", neither of which actually exist.

See documentation on "trigger-real"

ActiveCSS.first(selector string)
ActiveCSS.last(selector string)
ActiveCSS.next(selector string)
ActiveCSS.nextCycle(selector string [click] [step number])
ActiveCSS.previous(selector)
ActiveCSS.previousCycle(selector string [click] [step number])

Return an element for use based on a selector, following the rules of the focus-on-first, focus-on-last, etc. commands. See those corresponding action commands for details on what element is likely to be returned for use.

For nextCycle and previousCycle, there are additional parameters available that are not yet in the internal core commands. If you need it to focus and click on the target, include the word "click". If you need it to next or previous a number of steps, include the number of steps you want to go. Yell if you need it in the main command, or submit a patch to the core.

Note that the next and previous type functions require an element within the selector result to be already in focus.

Eg.

let el = ActiveCSS.nextCycle(".whateverNext");