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,292
12년 전 조회 2,050
12년 전 조회 3,708
12년 전 조회 8,541
12년 전 조회 4,179
12년 전 조회 3,758
12년 전 조회 3,156
12년 전 조회 4,007
12년 전 조회 4,388
12년 전 조회 1,622
12년 전 조회 2,751
12년 전 조회 2,751
12년 전 조회 1,281
12년 전 조회 1,305
12년 전 조회 8,446
12년 전 조회 1,559
12년 전 조회 3,793
12년 전 조회 6,369
12년 전 조회 1,585
12년 전 조회 1,173
12년 전 조회 1,342
12년 전 조회 3,315
12년 전 조회 1,100
12년 전 조회 1,850
12년 전 조회 1,273