Authored by lore-w

商品列表bug修改 code review by liuyue

@@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
13 <script> 13 <script>
14 seajs.use(['js/product/list', 'js/product/product'], function (list, product) { 14 seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
15 15
  16 + product.init(5);
16 window.onresize = function () { 17 window.onresize = function () {
17 setTimeout(function () { 18 setTimeout(function () {
18 product.init(5); 19 product.init(5);
@@ -28,6 +29,7 @@ @@ -28,6 +29,7 @@
28 <script> 29 <script>
29 seajs.use(['js/product/list', 'js/product/product'], function (list, product) { 30 seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
30 31
  32 + product.init(4);
31 window.onresize = function () { 33 window.onresize = function () {
32 setTimeout(function () { 34 setTimeout(function () {
33 product.init(4); 35 product.init(4);
@@ -143,22 +143,22 @@ exports.init = function(num) { @@ -143,22 +143,22 @@ exports.init = function(num) {
143 display: 'none' 143 display: 'none'
144 }); 144 });
145 }); 145 });
146 -  
147 - //鼠标放在颜色列表上效果  
148 - $(document).on('hover', '.good-select-color li', function() {  
149 - var coverImg = $(this).find('img').attr('data-cover'),  
150 - $coverImg = $(this).closest('.good-item-wrapper').find('.good-detail-img').find('img');  
151 -  
152 - $coverImg.attr('src', coverImg);  
153 - });  
154 -  
155 - // 左侧导航  
156 - $productListNav.click(function() {  
157 - if ($(this).hasClass('active')) {  
158 - $(this).find('.sort-child-list').stop(true, true).slideUp();  
159 - } else {  
160 - $(this).find('.sort-child-list').stop(true, true).slideDown();  
161 - }  
162 - $(this).toggleClass('active');  
163 - });  
164 -};  
  146 +};
  147 +
  148 +//鼠标放在颜色列表上效果
  149 +$(document).on('hover', '.good-select-color li', function() {
  150 + var coverImg = $(this).find('img').attr('data-cover'),
  151 + $coverImg = $(this).closest('.good-item-wrapper').find('.good-detail-img').find('img');
  152 +
  153 + $coverImg.attr('src', coverImg);
  154 +});
  155 +
  156 +// 左侧导航
  157 +$productListNav.click(function() {
  158 + if ($(this).hasClass('active')) {
  159 + $(this).find('.sort-child-list').stop(true, true).slideUp();
  160 + } else {
  161 + $(this).find('.sort-child-list').stop(true, true).slideDown();
  162 + }
  163 + $(this).toggleClass('active');
  164 +});