2012-12-25 6 views
0

문제가 있습니다. 나는이 같은 시차를 만들어야합니다 http://community.saucony.com/kinvara3/. 시차를 만드는 방법을 알고 있지만 마우스에서 스크롤을 한 번만 움직이는 것은 아닙니다.스크롤 마우스로 한 번의 움직임으로 시차를 스크롤하는 방법

스크롤에서 한 번의 이동과 스크롤이 직선으로 실행됩니다.

+0

dupicate? http://stackoverflow.com/questions/12461710/jquery-parallax-scrolling-effect-multi- Directional –

답변

0

스크롤이 트리거되면 일시적으로 스크롤을 비활성화해야합니다.

function disable_scroll() { 
    if (window.addEventListener) { 
     window.addEventListener('DOMMouseScroll', wheel, false); 
    } 
    window.onmousewheel = document.onmousewheel = wheel; 
    document.onkeydown = keydown; 
} 

function enable_scroll() { 
    if (window.removeEventListener) { 
     window.removeEventListener('DOMMouseScroll', wheel, false); 
    } 
    window.onmousewheel = document.onmousewheel = document.onkeydown = null; 
} 
+0

음, 좋아,하지만 내가 다음에해야 할 일은 무엇입니까? 내가 MouseWheel (jQuery)와 함께 노력하고있어하지만 실패한 :( – skozz