Showing
2 changed files
with
9 additions
and
4 deletions
@@ -242,10 +242,12 @@ $yohoPage.on('touchstart', '.color-list .block', function() { | @@ -242,10 +242,12 @@ $yohoPage.on('touchstart', '.color-list .block', function() { | ||
242 | // 颜色块切换勾选样式 | 242 | // 颜色块切换勾选样式 |
243 | $this.siblings('.chosed').removeClass('chosed'); | 243 | $this.siblings('.chosed').removeClass('chosed'); |
244 | 244 | ||
245 | - // 特殊处理 | 245 | + // 特殊处理: 老的选中尺码在新选中的颜色对应尺码中不存在, 需要将颜色的第一行对应的颜色块加上勾选样式. |
246 | if (-1 === curGoodNum) { | 246 | if (-1 === curGoodNum) { |
247 | $curColorBlock = $($colorRowList.eq(0).children().get(index)); | 247 | $curColorBlock = $($colorRowList.eq(0).children().get(index)); |
248 | $curColorBlock.addClass('chosed'); | 248 | $curColorBlock.addClass('chosed'); |
249 | + | ||
250 | + // 当前选择的颜色块,加上勾选样式 | ||
249 | } else { | 251 | } else { |
250 | $this.toggleClass('chosed'); | 252 | $this.toggleClass('chosed'); |
251 | } | 253 | } |
@@ -40,13 +40,16 @@ $('.employ span').each(function(index) { | @@ -40,13 +40,16 @@ $('.employ span').each(function(index) { | ||
40 | }); | 40 | }); |
41 | }); | 41 | }); |
42 | 42 | ||
43 | - | ||
44 | -$(window).scroll(function() { | ||
45 | - if ($(window).scrollTop() + $(window).height() > $('body').height() - 1) { | 43 | +function scrollHandler() { |
44 | + if ($(window).scrollTop() + $(window).height() > $('body').height() - 100) { | ||
46 | page++; | 45 | page++; |
47 | couponAJAX(statu, page); | 46 | couponAJAX(statu, page); |
48 | return; | 47 | return; |
49 | } | 48 | } |
49 | +} | ||
50 | 50 | ||
51 | +$(window).scroll(function() { | ||
52 | + window.requestAnimationFrame(scrollHandler); | ||
51 | }); | 53 | }); |
54 | + | ||
52 | couponAJAX(statu, page); | 55 | couponAJAX(statu, page); |
-
Please register or login to post a comment