getElementZIndex function

String? getElementZIndex(
  1. Element? element, [
  2. String? def
])

Returns the element z-index or element.parent z-index recursively.

Implementation

String? getElementZIndex(Element? element, [String? def]) {
  while (element != null) {
    var zIndex = element.style.zIndex;
    if (isNotEmptyObject(zIndex) && isInt(zIndex)) {
      return zIndex;
    }
    element = element.parent;
  }
  return def;
}