2026, 새로운 도약을 시작합니다.

카페24 상품롤링 관련.. 채택완료

그누보드와 관련 있는 부분은 아니지만.. 혹시 아시는 분 계시면 답변 좀 주실 수 있나요?

Copy


var leftCt = 0;

$(function () {

    $("#album").attr("top", "0");

    imgStart("R");

});

function imgStart(tp) {

    clearInterval($("#imgList").attr("timer"));

    if (tp == "R") { // 오른쪽 이동

        imgRight();

        $("#imgList").attr("timer", setInterval("imgRight()", 2000)); // 멈춰있는 시간

    } else { // 왼쪽이동

        if (leftCt == 0) {

            var leng = $("#imgList div").size();

            $("#imgList").css("left", parseInt($("#imgList div").eq(0).width() * -1));

            $("#imgList>div").eq(parseInt(leng - 1)).clone().prependTo($("#imgList"));

            $("#imgList>div").eq(leng).remove();

            leftCt = 1;

        }

        imgLeft();

        $("#imgList").attr("timer", setInterval("imgLeft()", 9000));

    }

}

function imgRight() {

    $("#imgList").animate({

        left: parseInt($("#imgList div").eq(0).width() * -1)

    }, 300, function () {

        $("#imgList").css("left", "0px");

        $("#imgList>div").eq(0).clone().appendTo($("#imgList"));

        $("#imgList>div").eq(0).remove();

    });

}

function imgLeft() {

    var leng = $("#imgList div").size();

    $("#imgList").animate({

        left: 0

    }, 300, function () {

        $("#imgList").css("left", "0px");

        $("#imgList").css("left", parseInt($("#imgList div").eq(0).width() * -1));

        $("#imgList>div").eq(parseInt(leng - 1)).clone().prependTo($("#imgList"));

        $("#imgList>div").eq(leng).remove();

    });

}

위 파일은 js 파일이구요, 

롤링은 잘 되나 롤오버시 멈추는 기능을 넣어야 하는데..

검색해서 이것 저것 넣어봐도 먹히질 않네요ㅠ

혹시 아시는 분 있으시면 알려주실 수 있나요?

원본 소스 출처 : https://blog.naver.com/wow-life/220896022732

답변 1개

$('#imgList').on({

'mouseenter': function(){clearInterval($(this).attr("timer"));},

'mouseleave': function(){imgStart("R");}

});

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

안 됩니다..

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

답변을 작성하려면 로그인이 필요합니다.

로그인
🐛 버그신고