const io = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
var sectionName = $(entry.target).attr("class");
var subGubun = sectionName.split(" ")[1];
//console.log( "active.class", subGubun );
$(entry.target).addClass('active').trigger("activeClass");
onSearch(subGubun);
}
});
});
document.querySelectorAll("section").forEach((item) => {
io.observe(item);
});
'web > javascript' 카테고리의 다른 글
Axios in Typescript (0) | 2022.09.04 |
---|---|
Fetch in TypeScript (0) | 2022.09.04 |
화면 활성화 비활성화 active deactive , visibilitychange (0) | 2022.08.19 |
antd useRef current.focus (0) | 2022.06.14 |
typescript onchange moment (0) | 2022.06.12 |
댓글