Function bodies 2,900 total
scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}Repobility · code-quality intelligence platform · https://repobility.com
scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}Repobility — same analyzer, your code, free for public repos · /scan/
scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}Repobility · severity-and-effort ranking · https://repobility.com
scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}About: code-quality intelligence by Repobility · https://repobility.com
scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}Repobility · code-quality intelligence platform · https://repobility.com
scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}Repobility — same analyzer, your code, free for public repos · /scan/
scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}scrollParentToChild function · javascript · L467-L478 (12 LOC)en/js/wowchemy.min.js
function scrollParentToChild(parent, child) {
const parentRect = parent.getBoundingClientRect();
const parentViewableArea = {
height: parent.clientHeight,
width: parent.clientWidth
};
const childRect = child.getBoundingClientRect();
const isChildInView = childRect.top >= parentRect.top && childRect.bottom <= parentRect.top + parentViewableArea.height;
if (!isChildInView) {
parent.scrollTop = childRect.top + parent.scrollTop - parentRect.top;
}
}