jQuery(8)
-
jQuery scroll 스크롤 끝을 확인하는 방법
브라우저 창 끝 이벤트 $(window).scroll(function(){ if ($(window).scrollTop() == $(document).height() - $(window).height()) { alert('End of Window'); } }); DIV 끝 이벤트 $("#inside").scroll( function() { var elem = $("#inside"); if ( elem[0].scrollHeight - elem.scrollTop() == elem.outerHeight()) { alert("End of Yellow"); } });
2021.12.21
-
jQuery node(DOM) 선택자
jQuery와 DOMjQuery에서는 선택자 및 필터링 기반 트리탐색이 가능하다. 선택자 기반 트리 탐색 메서드자식children('선택자')선택자에 해당하는 직계자식을 선택 find('선택자')선택자에 해당하는 자식, 자손을 선택선택자 생략 불가부모parent('선택자')선택자에 해당하는 직계부모를 선택 parents('선택자')선택자에 해당하는 부모, 조상을 선택 (body, html까지도..)선택자 생략 하지말자다음next('선택자')선택자에 해당하는 바로 다음 형제 요소 1개 를 선택 (친구) nextAll('선택자')선택자에 해당하는 모든 다음 형제 요소를 선택 (친구) 이전prev('선택자')선택자에 해당하는 이전 형제 요소 1개 를 선택 (친구) prevAll('선택자')선택자에 해당하는 ..
2021.12.08