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,257
12년 전 조회 2,020
12년 전 조회 3,676
12년 전 조회 8,503
12년 전 조회 4,141
12년 전 조회 3,729
12년 전 조회 3,129
12년 전 조회 3,969
12년 전 조회 4,358
12년 전 조회 1,588
12년 전 조회 2,714
12년 전 조회 2,709
12년 전 조회 1,242
12년 전 조회 1,273
12년 전 조회 8,398
12년 전 조회 1,511
12년 전 조회 3,752
12년 전 조회 6,333
12년 전 조회 1,553
12년 전 조회 1,141
12년 전 조회 1,310
12년 전 조회 3,289
12년 전 조회 1,068
12년 전 조회 1,815
12년 전 조회 1,243