|
|
var $ = require('yoho-jquery');
|
|
|
var $ = require('yoho-jquery')
|
|
|
var Lazyload = require('yoho-jquery-lazyload');
|
|
|
var common = require('../../common');
|
|
|
|
|
|
var query = common.queryString();
|
...
|
...
|
@@ -15,6 +16,8 @@ var YohoListPage = { |
|
|
require('yoho-jquery-nanoscroller');
|
|
|
require('../../plugins/check');
|
|
|
require('../../common/return-top');
|
|
|
|
|
|
Lazyload();
|
|
|
$('.nano').nanoScroller();
|
|
|
$('.yoho-ui-accordion', this.rootDoc).each(function() {
|
|
|
var opts = {
|
...
|
...
|
@@ -262,8 +265,8 @@ var YohoListPage = { |
|
|
var position = $(e.currentTarget).position();
|
|
|
var productId = $(e.currentTarget).data('id');
|
|
|
var imgsSize = $(e.currentTarget).find('.goods-list i').length;
|
|
|
var cols = imgsSize % 4 === 0 ? imgsSize / 4 : (imgsSize / 4 + 1);
|
|
|
var imgsCol;
|
|
|
var pos = {};
|
|
|
|
|
|
if (YohoListPage.goodsWrapperState && YohoListPage.productId !== productId) {
|
|
|
YohoListPage.goodsWrapperState = false;
|
...
|
...
|
@@ -271,13 +274,17 @@ var YohoListPage = { |
|
|
|
|
|
if (!YohoListPage.goodsWrapperState) {
|
|
|
YohoListPage.productId = productId;
|
|
|
position.top += 10;
|
|
|
pos.top = position.top + 10;
|
|
|
|
|
|
if (position.left > 500) {
|
|
|
position.left -= cols * 60;
|
|
|
pos.right = 0;
|
|
|
pos.left = 'auto';
|
|
|
} else {
|
|
|
pos.right = 'auto';
|
|
|
pos.left = position.left;
|
|
|
}
|
|
|
|
|
|
$(this.goodsWrapper).css(position);
|
|
|
$(this.goodsWrapper).css(pos);
|
|
|
$('.goods', this.goodsWrapper).html($(e.currentTarget).html());
|
|
|
$('.goods-img-list', this.goodsWrapper).empty();
|
|
|
$(e.currentTarget).find('.goods-list i').each(function(index) {
|
...
|
...
|
|