function elementIsVisible(elem) {
  return elem && elem.offsetWidth > 0 && elem.offsetHeight > 0 &&
      window.getComputedStyle(elem).visibility != 'hidden' &&
      window.getComputedStyle(elem).opacity > 0;
}
/**
 * Checks whether a given HTMLElement exists and is visible.
 * @param {HTMLElement|undefined} elem An HTMLElement.
 * @return {boolean} True if the element exists and is visible.
 */
Checks whether a given HTMLElement exists and is visible.
Checks whether a given HTMLElement exists and is visible .
function elementIsVisible(elem) {
  return elem && elem.offsetWidth > 0 && elem.offsetHeight > 0 &&
      window.getComputedStyle(elem).visibility != 'hidden' &&
      window.getComputedStyle(elem).opacity > 0;
}
function elementIsVisible ( elem ) { return elem && elem . offsetWidth > 0 && elem . offsetHeight > 0 && window . getComputedStyle ( elem ) . visibility != 'hidden' && window . getComputedStyle ( elem ) . opacity > 0 ; }
Checks whether a given HTMLElement exists and is visible.
Checks whether a given HTMLElement exists and is visible .