doAction( “focus_area” )

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

Fires, after an area received the “focus” state.

If the page contains multiple Popups, only one Popup can have the “focus” state at any moment.

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


(DiviAreaItem, required) The Area which will be focused.


// Add a special CSS class to the focused Area.
DiviArea.addAction( 'focus_area', function( area ) {
    area.addClass( 'special-focus' );


During the “focus” process, all event handlers are attached to the Area – like custom close buttons handlers. When the focus_area event is fired, the Area is fully prepared with all event handlers in place.

Was this article helpful?

Related Articles