2014-09-17 50 views
1

iScroll v5.1.1을 사용하고 있으며 사용자가 페이지에서 스크롤 작업을 시작하고 종료 할 때 이벤트를 원합니다.scrollstart 및 scrollend에서 이벤트 가져 오기 - iscroll

다음

내 자바 스크립트이며,

myScroll = new IScroll('#scrollinginside', { 
    scrollbars: true, 
    mouseWheel: true, 
    interactiveScrollbars: true, 
    shrinkScrollbars: 'scale', 
    fadeScrollbars: false, 
    checkDOMChanges: true, 
    onScrollStart: function() { 
     console.log('scrolling is started'); 
    }, 
    onScrollEnd: function() { 
     console.log('scrolling stopped'); 
    } 
}); 

을하지만 페이지를 통해 이동하려고 할 때 어떤 이벤트가 registred 없습니다. 내 자바 스크립트에 무슨 문제가 있니? 내가 놓친 게 있니?

답변

2

는 사용하여이 문제를 해결

myScroll = new IScroll('#scrollinginside', { 
    scrollbars: true, 
    mouseWheel: true, 
    interactiveScrollbars: true, 
    shrinkScrollbars: 'scale', 
    fadeScrollbars: false, 
    checkDOMChanges: true 
}); 


myScroll.on ('scrollStart', function() { 
console.log('Started'); 
}); 
myScroll.on ('scrollEnd', function() { 
console.log('Ended'); 
});