...
|
...
|
@@ -28,39 +28,45 @@ exports.init = function(num) { |
|
|
$shopEntryArea = $('.shop-entry-area'),
|
|
|
shopEntryLen = $shopEntry.length;
|
|
|
|
|
|
if (shopEntryLen > 0) {
|
|
|
if (shopEntryLen % 3 === 1) {
|
|
|
$shopEntry.eq(shopEntryLen - 1).css({
|
|
|
width: '100%'
|
|
|
});
|
|
|
|
|
|
$shopEntry.eq(shopEntryLen - 1).find('.name').css({
|
|
|
width: '600px'
|
|
|
});
|
|
|
} else if (shopEntryLen % 3 === 2) {
|
|
|
$shopEntry.eq(shopEntryLen - 1).css({
|
|
|
width: '49%'
|
|
|
});
|
|
|
|
|
|
$shopEntry.eq(shopEntryLen - 2).css({
|
|
|
width: '49%'
|
|
|
});
|
|
|
|
|
|
$shopEntry.eq(shopEntryLen - 1).find('.name').css({
|
|
|
width: '230px'
|
|
|
});
|
|
|
|
|
|
$shopEntry.eq(shopEntryLen - 2).find('.name').css({
|
|
|
width: '230px'
|
|
|
});
|
|
|
}
|
|
|
|
|
|
$('.shop-entry:nth-child(3n+1)').css({
|
|
|
marginLeft: 0
|
|
|
});
|
|
|
|
|
|
$shopEntryArea.show();
|
|
|
}
|
|
|
if (shopEntryLen > 1) {
|
|
|
|
|
|
if (shopEntryLen === 3) {
|
|
|
$shopEntry.css({
|
|
|
width: '32%'
|
|
|
});
|
|
|
} else if (shopEntryLen % 2) {
|
|
|
|
|
|
// 大于 2 ,并且是基数
|
|
|
$('.shop-entry:gt(' + (shopEntryLen - 4) + ')').css({
|
|
|
width: '32%'
|
|
|
});
|
|
|
}
|
|
|
|
|
|
$('.shop-entry:nth-child(2n+1)').css({
|
|
|
marginLeft: 0
|
|
|
});
|
|
|
|
|
|
$shopEntry.last().css({
|
|
|
marginLeft: '2%'
|
|
|
});
|
|
|
|
|
|
if (shopEntryLen % 2 === 0) {
|
|
|
$shopEntry.find('.name').css({
|
|
|
width: '50%'
|
|
|
});
|
|
|
} else if (shopEntryLen % 3 === 0) {
|
|
|
$shopEntry.find('.name').css({
|
|
|
width: '26%'
|
|
|
});
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
$shopEntry.css({
|
|
|
width: '100%'
|
|
|
});
|
|
|
}
|
|
|
|
|
|
$shopEntryArea.slideDown();
|
|
|
|
|
|
productList = null;
|
|
|
|
...
|
...
|
@@ -266,4 +272,4 @@ $productListNav.find('h3').click(function(event) { |
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}()); |
|
|
\ No newline at end of file |
|
|
}()); |
...
|
...
|
|