s

마우스휠이벤트 등록 및 활용

//마우스휠이벤트 등록
if(window.attachEvent) {
    window.attachEvent("onmousewheel" ,function(event){moveSheet(event);});
}
else if(window.addEventListener) {
    if(nBrowserCheck == "Firefox")
        window.addEventListener("DOMMouseScroll", function(event){moveSheet(event);}, false);
    else
        window.addEventListener("mousewheel", function(event){moveSheet(event);}, false);
}



//활용
if(evt.detail) {
    WData = evt.detail;
   
    if (WData <= -3) {
        Arrow = "up";
    }
    else if (WData >= 3) {
        Arrow = "down";
    }
}
else {
    WData = evt.wheelDelta;

    if (WData >= 120) {
        Arrow = "up";
    }
    else if (WData <= -120) {
        Arrow = "down";
    }
}

|

댓글 5개

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

팁게시판

디자인과 관련된 유용한 정보를 공유하세요. 질문은 상단의 QA에서 해주시기 바랍니다.

+
제목 글쓴이 날짜 조회
12년 전 조회 3,241
12년 전 조회 2,005
12년 전 조회 3,659
12년 전 조회 8,487
12년 전 조회 4,127
12년 전 조회 3,710
12년 전 조회 3,114
12년 전 조회 3,955
12년 전 조회 4,340
12년 전 조회 1,572
12년 전 조회 2,695
12년 전 조회 2,689
12년 전 조회 1,228
12년 전 조회 1,254
12년 전 조회 8,380
12년 전 조회 1,488
12년 전 조회 3,733
12년 전 조회 6,318
12년 전 조회 1,539
12년 전 조회 1,128
12년 전 조회 1,299
12년 전 조회 3,277
12년 전 조회 1,056
12년 전 조회 1,800
12년 전 조회 1,232
🐛 버그신고