|
@@ -57,6 +57,7 @@ function setActive($item) { |
|
@@ -57,6 +57,7 @@ function setActive($item) { |
57
|
|
57
|
|
58
|
var $colorList = $item.find('.color-list');
|
58
|
var $colorList = $item.find('.color-list');
|
59
|
var $sizeList = $item.find('.size-list');
|
59
|
var $sizeList = $item.find('.size-list');
|
|
|
60
|
+ var activeIndex = 0;
|
60
|
|
61
|
|
61
|
$colorList.find('.img-box').each(function(i, box) {
|
62
|
$colorList.find('.img-box').each(function(i, box) {
|
62
|
var $box = $(box);
|
63
|
var $box = $(box);
|
|
@@ -64,10 +65,14 @@ function setActive($item) { |
|
@@ -64,10 +65,14 @@ function setActive($item) { |
64
|
if ($box.find('img').data('color') === color) {
|
65
|
if ($box.find('img').data('color') === color) {
|
65
|
$colorList.find('.img-box').eq(i).addClass('active');
|
66
|
$colorList.find('.img-box').eq(i).addClass('active');
|
66
|
|
67
|
|
|
|
68
|
+ activeIndex = i;
|
|
|
69
|
+
|
67
|
return false;
|
70
|
return false;
|
68
|
}
|
71
|
}
|
69
|
});
|
72
|
});
|
70
|
|
73
|
|
|
|
74
|
+ $sizeList = $sizeList.eq(activeIndex).removeClass('hide');
|
|
|
75
|
+
|
71
|
$sizeList.find('span').each(function(i, s) {
|
76
|
$sizeList.find('span').each(function(i, s) {
|
72
|
var $size = $(s);
|
77
|
var $size = $(s);
|
73
|
|
78
|
|