Showing
1 changed file
with
7 additions
and
3 deletions
@@ -130,13 +130,16 @@ $cartnewSum.one('click', 'input[type="checkbox"]', function() { | @@ -130,13 +130,16 @@ $cartnewSum.one('click', 'input[type="checkbox"]', function() { | ||
130 | }; | 130 | }; |
131 | choiceOut(dataJSON); | 131 | choiceOut(dataJSON); |
132 | }); | 132 | }); |
133 | + | ||
133 | // 滚动到第一个选中的商品 | 134 | // 滚动到第一个选中的商品 |
134 | -function scrollToFirst(){ | 135 | +function scrollToFirst() { |
135 | var $selected = $('.pay-wapper tbody tr').find('.cart-item-check:checked'); | 136 | var $selected = $('.pay-wapper tbody tr').find('.cart-item-check:checked'); |
136 | var top = 0; | 137 | var top = 0; |
137 | - if($selected.length > 0){ | 138 | + |
139 | + if ($selected.length > 0) { | ||
138 | $selected = $selected.eq(0); | 140 | $selected = $selected.eq(0); |
139 | } | 141 | } |
142 | + | ||
140 | top = $selected.offset().top - 50; | 143 | top = $selected.offset().top - 50; |
141 | $('html,body').scrollTop(top); | 144 | $('html,body').scrollTop(top); |
142 | return false; | 145 | return false; |
@@ -891,5 +894,6 @@ $payWapper.on('selectstart', function() { | @@ -891,5 +894,6 @@ $payWapper.on('selectstart', function() { | ||
891 | }); | 894 | }); |
892 | $goodsDetail.on('selectstart', function() { | 895 | $goodsDetail.on('selectstart', function() { |
893 | return false; | 896 | return false; |
894 | -}); | 897 | +}); |
898 | + | ||
895 | scrollToFirst(); | 899 | scrollToFirst(); |
-
Please register or login to post a comment