...
|
...
|
@@ -24,6 +24,31 @@ lazyLoad($('img.lazy')); |
|
|
* @num 每列存放商品的个数
|
|
|
*/
|
|
|
exports.init = function(num) {
|
|
|
var $shopEntry = $('.shop-entry'),
|
|
|
$shopEntryArea = $('.shop-entry-area'),
|
|
|
shopEntryLen = $shopEntry.length;
|
|
|
|
|
|
if (shopEntryLen > 0) {
|
|
|
if(shopEntryLen % 3 === 1) {
|
|
|
$shopEntry.eq(shopEntryLen-1).css({
|
|
|
width: '100%'
|
|
|
});
|
|
|
} else if (shopEntryLen % 3 === 2) {
|
|
|
$shopEntry.eq(shopEntryLen-1).css({
|
|
|
width: '49%'
|
|
|
});
|
|
|
|
|
|
$shopEntry.eq(shopEntryLen-2).css({
|
|
|
width: '49%'
|
|
|
});
|
|
|
}
|
|
|
|
|
|
$('.shop-entry:nth-child(3n+1)').css({
|
|
|
marginLeft: 0
|
|
|
});
|
|
|
|
|
|
$shopEntryArea.show();
|
|
|
}
|
|
|
|
|
|
productList = null;
|
|
|
|
...
|
...
|
|