DiviAreaItem.setData()

  1. Home
  2. Knowledge Base
  3. Codex
  4. JS API
  5. JS Functions
  6. DiviAreaItem.setData()
DiviAreaItem.setData(key, value)

// Alias:
DiviArea.configArea(area, attrib, value)

Changes an area configuration value.

Params

key
(string, required) The option name. The option name is converted to lower-case, all non-alpha-numeric characters are removed (see example below)
value
(mixed, required) The new value.

Returns

A reference to the current DiviAreaitem for chaining.

Examples

// The following statements are all equal, because the config key
// is sanitized to "zindex" (lower-case, only alpha-numeric chars):
area.setData('Z_Index', 100);
area.setData('z-index', 100);
area.setData('zIndex', 100);
area.setData('zindex', 100);

Notes

List of all configuration options; for better readability, the keys include dashes, though they are not needed:

container
(jQuery element)
The parent container, used by the .append() method.
is-blocking
not-blocking
(boolean)
Whether ESC key can close the Area.
is-modal
not-modal
(boolean)
Whether background click can close the Area.
shadow
no-shadow
(boolean)
Whether the default shadow is displayed.
on-desktop
not-desktop
(boolean)
Whether Area is visible on desktop devices.
on-mobile
not-mobile
(boolean)
Whether Area is visible on phones.
on-tablet
not-tablet
(boolean)
Whether Area is visible on tablets.
overflow
(string)
Overflow behavior [show|full-height|clip].
position
(string)
Position string “vertical-horizontal”.
position-h
(string)
Horizontal position [left|center|right].
position-v
(string)
Vertical position [top|center|bottom].
close-alt
(boolean)
Transparent close button.
dark-mode
(boolean)
Dark close button.
show-close
not-close
(boolean)
Whether the close button is visible.
singleton
(boolean)
Whether other Popups are closed when this Popup is opened.
trigger-exit
(boolean)
Whether this Area opens on Exit-Intent.
with-loader
(boolean)
Whether a loading animation is displayed in the background.
wrap-classes
(string)
Additional class names of the wrapper class.
z-index
(int)
Z-Index of the wrapper class.
close-trigger
(string)
The value defines when a Hover Area should be hidden again. Possible values are:
click .. Hide the Hover Area when the user clicks anywhere outside the Area.
hover .. Hide the Hover Area when the mouse leaves the trigger element.
Only used by Hover Areas
close-delay
(float)
The value is a float number that defines a delay (in seconds) between the closes-trigger event and actually hiding a Hover Area.
Only used by Hover Areas
attach-to
(jQuery element)
to align the Hover Area.
static
(boolean)
Internal use for static inline Areas.
has-show-anim
(boolean)
Internal use.

Was this article helpful?

Related Articles