DiviArea.Utils.getStyleDef()

  1. Home
  2. Knowledge Base
  3. Codex
  4. JS API
  5. JS Functions
  6. DiviArea.Utils.getStyleDef()
DiviArea.Utils.getStyleDef(element, prop, ignore)

Returns the defined CSS value for the given property of an element.

This defined style is not resloved, i.e., it will return “auto” instead of a specific value (like “262px”) when the CSS rule is set to “auto”.

Params

element
(HTMLElement|string, required) An HTMLElement, or an Area ID.
prop
(string, required) The CSS property to find, e.g. “padding-left”.
ignore
(array, required) List of CSS selectors to ignore, e.g. [".et_pb_section"].

Returns

A string with the style definition, or an empty string when the style is not defined.

Notes

No notes

Was this article helpful?

Related Articles