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,246
12년 전 조회 2,012
12년 전 조회 3,663
12년 전 조회 8,490
12년 전 조회 4,131
12년 전 조회 3,716
12년 전 조회 3,119
12년 전 조회 3,959
12년 전 조회 4,346
12년 전 조회 1,578
12년 전 조회 2,703
12년 전 조회 2,694
12년 전 조회 1,234
12년 전 조회 1,260
12년 전 조회 8,387
12년 전 조회 1,496
12년 전 조회 3,741
12년 전 조회 6,322
12년 전 조회 1,544
12년 전 조회 1,131
12년 전 조회 1,303
12년 전 조회 3,282
12년 전 조회 1,061
12년 전 조회 1,805
12년 전 조회 1,236
🐛 버그신고