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

· 2년 전 · 1365 · 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 팁자료실

+
제목 글쓴이 날짜 조회
2년 전 조회 1,694
2년 전 조회 1,866
2년 전 조회 1,229
2년 전 조회 1,763
2년 전 조회 1,667
2년 전 조회 2,268
2년 전 조회 1,682
2년 전 조회 1,137
2년 전 조회 1,991
2년 전 조회 1,468
2년 전 조회 1,341
2년 전 조회 2,289
2년 전 조회 1,743
2년 전 조회 2,241
2년 전 조회 1,366
2년 전 조회 2,204
2년 전 조회 1,041
2년 전 조회 1,797
2년 전 조회 1,561
2년 전 조회 2,857
2년 전 조회 1,781
2년 전 조회 2,075
2년 전 조회 2,560
2년 전 조회 2,584
2년 전 조회 1,630
2년 전 조회 1,752
2년 전 조회 1,577
2년 전 조회 1,470
2년 전 조회 2,581
2년 전 조회 2,747