doAction( “show_area” )

  1. Home
  2. Knowledge Base
  3. Codex
  4. JS API
  5. JS Actions
  6. doAction( “show_area” )
doAction( "show_area", area );
doAction( "show_area_{key}", area );

Fires after the visible state changed to “visible”, or the intro-animation has started.

The dynamic part of the filter name is the sanitized Area key. See DiviAreaItem.theKey() for details.

Params

area
(DiviAreaItem, required) The Area object.

Examples

// Send an event to google analytics, once a Popup is displayed.
DiviArea.addAction( 'show_area', function( area ) {
    var type = area.getType();
    var key = area.getKey();

    if ( 'popup' === type ) {
        ga( 'send', 'event', 'Popup', 'open', key );
    }
});

Notes

Was this article helpful?

Related Articles