테스트 사이트 - 개발 중인 베타 버전입니다

게시판 컨탠츠 내 이미지별로 넘버링하기

· 1년 전 · 1255 · 1

해당 게시판의 view.skin.php 수정.

 

<css 추가>

 

.image-number {
    position: absolute;
    top: 3%;
    left: 3%;
    background-color: white;
    color: black;
    border-radius: 50%;
    font-size: 10px;
    width: 17px;
    height: 17px;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

 

<하단 스크립트 추가>

$(document).ready(function() {
    $("#bo_v_con img").each(function(index) {
        var imageNumber = index + 1; // 이미지 번호 (1부터 시작)
        var numberDiv = $("<div>").addClass("image-number").text(imageNumber);
        $(this).css("position", "relative").parent().css("position", "relative");
        $(this).before(numberDiv);
    });
});
 

예시

 

2040779859_1703072257.7152.png

 

유의사항 : CSS는 본인 환경에 맞도록 조정하셔야 합니다.

 

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 1개

좋아요 추천합니다.

게시판 목록

그누보드5 팁자료실

글쓰기
🐛 버그신고