function _isElementVisible(element) {
let rect = element.getBoundingClientRect();
let vWidth = window.innerWidth || doc.documentElement.clientWidth;
let vHeight = window.innerHeight || doc.documentElement.clientHeight;
let elemFromPoint = function (x, y){
return document.elementFromPoint(x, y)
};
if (rect.right < 0 || rect.bottom < 0
|| rect.left > vWidth || rect.top > vHeight)
return false;
return (
element.contains(elemFromPoint(rect.left, rect.top))
|| element.contains(elemFromPoint(rect.right, rect.top))
|| element.contains(elemFromPoint(rect.right, rect.bottom - 1))
|| element.contains(elemFromPoint(rect.left, rect.bottom - 1))
);
}
function _isElementVisible(element) {
let rect = element.getBoundingClientRect();
let vWidth = window.innerWidth || doc.documentElement.clientWidth;
let vHeight = window.innerHeight || doc.documentElement.clientHeight;
if (rect.right < 0 || rect.bottom < 0 || rect.left > vWidth || rect.top > vHeight) return false;
return (
element.contains(document.elementFromPoint(rect.left, rect.top))
|| element.contains(document.elementFromPoint(rect.right, rect.top))
|| element.contains(document.elementFromPoint(rect.right, rect.bottom - 1))
|| element.contains(document.elementFromPoint(rect.left, rect.bottom - 1))
);
}