// 스크롤시 섹션에 맞는 tab에 active 주기
$("#wrap_content").scroll(function () {
const height = $("#wrap_content").scrollTop(); // 해당 스크롤 좌표값(높이)
const content = $('.content_area');
content.each(function () {
const a = $(this).position();
if (a.top == height || a.top < height + 200) {
const thisIndex = $(this).index()
const tabIndex = $('.tab').eq(thisIndex);
tabIndex.addClass('active'); //
$('.tab').not(tabIndex).removeClass('active')
}
})
});'Publish > JavaScript' 카테고리의 다른 글
| 라디오 탭 메뉴 구현 (0) | 2022.11.11 |
|---|---|
| 스크롤시 nav에 active 주기 (0) | 2022.11.11 |
| 체크박스 전체 선택,해제 / 라디오 전체 선택,해제 (약관) (0) | 2022.09.09 |
| select,option 사용해서 셀렉트 커스텀하기 (0) | 2022.09.08 |
| 제이쿼리 기능 (0) | 2022.08.28 |