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,272
12년 전 조회 2,033
12년 전 조회 3,687
12년 전 조회 8,518
12년 전 조회 4,155
12년 전 조회 3,743
12년 전 조회 3,143
12년 전 조회 3,986
12년 전 조회 4,374
12년 전 조회 1,604
12년 전 조회 2,728
12년 전 조회 2,729
12년 전 조회 1,258
12년 전 조회 1,290
12년 전 조회 8,420
12년 전 조회 1,532
12년 전 조회 3,774
12년 전 조회 6,350
12년 전 조회 1,566
12년 전 조회 1,155
12년 전 조회 1,325
12년 전 조회 3,300
12년 전 조회 1,085
12년 전 조회 1,834
12년 전 조회 1,263