Closed yuanyu90221 closed 7 years ago
都 ok,但是這一段有 bug 喔:
$(window).scroll(function() {
if($(window).scrollTop() + $(window).height() == $(document).height() && (isLoading == false)) {
// 滑到底部的時候
setTimeout(loadTwitchAPI, 1000);
}
});
因為你設置setTimeout(loadTwitchAPI, 1000);
,所以isLoading
會在一秒之後才設成 true
意思就是如果在一秒之內能夠觸發兩次的話,就會載入同樣的 channel 兩次了
感謝提醒 ,目前已修正邏輯到 scroll down 就修改 loading = true
slack 帳號
哪一個作業
+7. 走向國際:i18n
作業 Github 連結
https://github.com/yuanyu90221/frontend-intermediate-course/tree/master/answers/hw7
作業 Github Page 連結
https://yuanyu90221.github.io/frontend-intermediate-course/answers/hw7/
其他補充說明
https://github.com/yuanyu90221/frontend-intermediate-course/blob/master/answers/hw7/README.md