카페24 상품롤링 관련..

카페24 상품롤링 관련..

QA

카페24 상품롤링 관련..

본문

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

 


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");}

});

답변을 작성하시기 전에 로그인 해주세요.
전체 220
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT