aszx87410 / frontend-intermediate-course

It's a free online course about some frontend tech including Ajax, CORS, gulp, webpack and so on.
266 stars 88 forks source link

[作業]繳交hw7 #103

Closed yuanyu90221 closed 7 years ago

yuanyu90221 commented 7 years ago

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

aszx87410 commented 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 兩次了

yuanyu90221 commented 7 years ago

感謝提醒 ,目前已修正邏輯到 scroll down 就修改 loading = true