IT/코딩 Javascript 17

Article Thumbnail jQuery 메서드 비교 append, prepend append() Inserts the specified content, to the end of each element in the set of matched elements. Inserts the specified content as the last child of each element in the jQuery collection. Puts data inside an element at the last index 잘라서 붙여 넣기(이동) / 콘텐츠 끼워 넣기 syntax: .append( content [, content ] ) .append( function ) $gnb.find("li").each(function() { if ( $(this).find("a").prop("href") == wind.. 2021. 8. 22.
Article Thumbnail jQuery 메서드 비교 hide, detach, empty, remove hide() Hides the matched elements. Sets the matched elements' CSS display property to none. detach() Removes the set of matched elements from the DOM. Removes all child elements with the selected elements. Keeps all data and event handlers of the removed elements. Preferred to remove elements but to keep copy of the removed elements for reuse at a later time. How to reinsert the detached element.. 2021. 8. 15.
Article Thumbnail 구글 애드센스 블로그 홈 화면에서 제외 구글에 웹 페이지 로딩 속도, 시인성 등 여러 가지 사용자 접속 환경을 정밀하게 측정하는 PageSpeed Insights라는 도구가 있습니다. 블로그의 수정이 잦으니까 가끔 알 수 없는 오류가 발생하기도 하고 이 도구의 측정 점수가 뚝 떨어지기도 합니다. 심쿵하기도 하고 다시 복구해야 하는 데 마음이 편하지 않습니다. 자주 하니까 짜증이 나는 거죠. 편하게 모든 과오는 블로그에 붙여 놓은 애드센스와 애드핏 배너 광고의 탓으로 돌립니다. 블로그 첫 페이지(홈 화면)에서 광고를 제거하면 측정 점수가 잘 나오고 처음 접속자가 쾌적하게 블로그 구독을 시작할 수 있습니다. 거기에 덧붙여 구글에서 검색 순위를 높여준다는 확인되지 않은 소문도 있습니다. 일단 고득점만 하면 됩니다. 인덱스, 본문 페이지는 나중에 따.. 2021. 8. 11.
Article Thumbnail Book Club 스킨 홈 커버 아이템 오류 수정 코드 작성자: openperl@naver.com 블로그: netwaremore, TechWrite, Translation (tistory.com) 2021.08.14 - 더보기 숫자 표시 부분 스크립트 파일 오타 교정 - 수정한 첨부 파일 등록 2021.07.27 - 더보기 버튼에 숨긴 글 숫자 추가 ※ 코드에 오류가 있을 경우 댓글 남겨 주시면 많은 도움이 됩니다. 오류 발생 원인 1. 조건식 오류 if ( $item.length > 4 ){ $item.each(function(){ if ( $(this).index() > 4 ) $(this).hide(); }); $cover.append('more'); $cover.on("click", ".more", function(){ $(this).remove.. 2021. 7. 20.
Article Thumbnail Position Sticky를 구현하는 Fixed JS 코드 3차 수정본 1. 원글: Position Sticky를 구현하는 Fixed JS 코드 오류 수정 2. 수정: Position Sticky를 구현하는 Fixed JS 코드 2차 수정본 3. 수정: 본문 4. 수정: Position Sticky를 구현하는 Fixed JS 코드 4차 수정본 5. 활용: Position Sticky를 구현하는 Fixed JS 코드 활용 2, 3차 수정 코드 비교하고 간단한 설명 덧붙입니다. ※ The HTMLElement.offsetTop read-only property returns the distance of the outer border of the current element relative to the inner border of the top of the offsetParent.. 2021. 6. 13.
Article Thumbnail Position Sticky를 구현하는 Fixed JS 코드 2차 수정본 1. 원글: Position Sticky를 구현하는 Fixed JS 코드 오류 수정 2. 수정: 본문 3. 수정: Position Sticky를 구현하는 Fixed JS 코드 3차 수정 4. 수정: Position Sticky를 구현하는 Fixed JS 코드 4차 수정 5. 활용: Position Sticky를 구현하는 Fixed JS 코드 활용 윗글에 이어서 다시 수정한 부분을 반영하여 설명 진행합니다. 수정 내역 1. 블로그의 댓글 리스트에서 한 항목 링크를 누르면 페이지가 열리면서 하단 댓글 리스트로 이동합니다. 이때 "position: fixed"입니다. 페이지의 최상단으로 이동하면 "position: static"으로 변경되어야 하는 데, 오류 때문에 바뀌지 않습니다. 위치 코드를 출력하는 검사.. 2021. 6. 10.
Article Thumbnail Position Sticky를 구현하는 Fixed JS 코드 오류 수정 1. 원글: 본문 2. 수정: Position Sticky를 구현하는 Fixed JS 코드 2차 수정 3. 수정: Position Sticky를 구현하는 Fixed JS 코드 3차 수정 4. 수정: Position Sticky를 구현하는 Fixed JS 코드 4차 수정 5. 활용: Position Sticky를 구현하는 Fixed JS 코드 활용 Position Sticky는 웹 페이지의 일부 Element가 사전 설정한 지점에서 움직임을 중지하고 고정되어 Position Fixed의 기능을 시작하는 매우 유용한 CSS 코드입니다. ​"Position Relative + Position Fixed"를 하나로 통합한 것이라고 말할 수 있습니다. 대형 포털과 블로그 등 여러 사이트의 페이지 상단에 배치된 내.. 2021. 4. 19.