Authored by cailing

再次购买添加锚点

@@ -130,7 +130,17 @@ $cartnewSum.one('click', 'input[type="checkbox"]', function() { @@ -130,7 +130,17 @@ $cartnewSum.one('click', 'input[type="checkbox"]', function() {
130 }; 130 };
131 choiceOut(dataJSON); 131 choiceOut(dataJSON);
132 }); 132 });
133 - 133 +// 滚动到第一个选中的商品
  134 +function scrollToFirst(){
  135 + var $selected = $('.pay-wapper tbody tr').find('.cart-item-check:checked');
  136 + var top = 0;
  137 + if($selected.length > 0){
  138 + $selected = $selected.eq(0);
  139 + }
  140 + top = $selected.offset().top - 50;
  141 + $('html,body').scrollTop(top);
  142 + return false;
  143 +}
134 function isCheck(obj, className) { 144 function isCheck(obj, className) {
135 selectArray = []; 145 selectArray = [];
136 dataJSON = {}; 146 dataJSON = {};
@@ -880,4 +890,5 @@ $payWapper.on('selectstart', function() { @@ -880,4 +890,5 @@ $payWapper.on('selectstart', function() {
880 }); 890 });
881 $goodsDetail.on('selectstart', function() { 891 $goodsDetail.on('selectstart', function() {
882 return false; 892 return false;
883 -});  
  893 +});
  894 +scrollToFirst();