@68publishers/cookie-consent
Version:
Cookie consent wrapper based on orestbida/cookieconsent with GTM integration.
23 lines (17 loc) • 395 B
JavaScript
export function checkVisibility(element) {
if (!(element instanceof Element)) {
return false;
}
let el = element;
while (el) {
const style = getComputedStyle(el);
if (
style.display === 'none' ||
el.hasAttribute('hidden')
) {
return false;
}
el = el.parentElement;
}
return true;
}