...
|
...
|
@@ -28,40 +28,46 @@ 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%'
|
|
|
});
|
|
|
if (shopEntryLen > 1) {
|
|
|
|
|
|
$shopEntry.eq(shopEntryLen - 1).find('.name').css({
|
|
|
width: '600px'
|
|
|
if (shopEntryLen === 3) {
|
|
|
$shopEntry.css({
|
|
|
width: '32%'
|
|
|
});
|
|
|
} else if (shopEntryLen % 3 === 2) {
|
|
|
$shopEntry.eq(shopEntryLen - 1).css({
|
|
|
width: '49%'
|
|
|
} else if (shopEntryLen % 2) {
|
|
|
|
|
|
// 大于 2 ,并且是基数
|
|
|
$('.shop-entry:gt(' + (shopEntryLen - 4) + ')').css({
|
|
|
width: '32%'
|
|
|
});
|
|
|
}
|
|
|
|
|
|
$shopEntry.eq(shopEntryLen - 2).css({
|
|
|
width: '49%'
|
|
|
$('.shop-entry:nth-child(2n+1)').css({
|
|
|
marginLeft: 0
|
|
|
});
|
|
|
|
|
|
$shopEntry.eq(shopEntryLen - 1).find('.name').css({
|
|
|
width: '230px'
|
|
|
$shopEntry.last().css({
|
|
|
marginLeft: '2%'
|
|
|
});
|
|
|
|
|
|
$shopEntry.eq(shopEntryLen - 2).find('.name').css({
|
|
|
width: '230px'
|
|
|
if (shopEntryLen % 2 === 0) {
|
|
|
$shopEntry.find('.name').css({
|
|
|
width: '50%'
|
|
|
});
|
|
|
} else if (shopEntryLen % 3 === 0) {
|
|
|
$shopEntry.find('.name').css({
|
|
|
width: '26%'
|
|
|
});
|
|
|
}
|
|
|
|
|
|
$('.shop-entry:nth-child(3n+1)').css({
|
|
|
marginLeft: 0
|
|
|
} else {
|
|
|
$shopEntry.css({
|
|
|
width: '100%'
|
|
|
});
|
|
|
|
|
|
$shopEntryArea.show();
|
|
|
}
|
|
|
|
|
|
$shopEntryArea.slideDown();
|
|
|
|
|
|
productList = null;
|
|
|
|
|
|
$goodItem.unbind();
|
...
|
...
|
|