修复有货币页面不滚动问题。code review by LZF
Showing
1 changed file
with
7 additions
and
3 deletions
@@ -16,12 +16,16 @@ function ajaxCurrencyDetail(page) { | @@ -16,12 +16,16 @@ function ajaxCurrencyDetail(page) { | ||
16 | }); | 16 | }); |
17 | } | 17 | } |
18 | 18 | ||
19 | -$(window).scroll(function() { | ||
20 | - if ($(window).scrollTop() + $(window).height() > $('body').height() - 1) { | 19 | +function scrollHandler() { |
20 | + if ($(window).scrollTop() + $(window).height() > $('body').height() - 100) { | ||
21 | page++; | 21 | page++; |
22 | ajaxCurrencyDetail(page); | 22 | ajaxCurrencyDetail(page); |
23 | return; | 23 | return; |
24 | } | 24 | } |
25 | +} | ||
26 | + | ||
27 | +$(window).scroll(function() { | ||
28 | + window.requestAnimationFrame(scrollHandler); | ||
25 | }); | 29 | }); |
26 | 30 | ||
27 | -ajaxCurrencyDetail(page); | ||
31 | +ajaxCurrencyDetail(page); |
-
Please register or login to post a comment