view.js
463 Bytes
import {
View
} from 'js/yoho-mvc';
class GetMore extends View {
constructor() {
super('.material-c');
// srcoll to load more
$(window).scroll(() => {
window.requestAnimationFrame(this.scrollHandler.bind(this));
});
}
scrollHandler() {
if (($(window).scrollTop() + $(window).height() >= $(document).height() * 0.8)) {
this.emit('more');
}
}
}
export {
GetMore
};