Authored by 阿达

商品列表展出栏bug fix

... ... @@ -83,8 +83,8 @@ exports.init = function(num) {
});
}
//原来的
//productList.addHandler('MouseEnter', function(event) {
// 原来的
// productList.addHandler('MouseEnter', function(event) {
// var itemMr = 10, // list的右边距
// itemMb = 35, // list的下边距
// ulStr = '',
... ... @@ -157,17 +157,15 @@ exports.init = function(num) {
// $goodInfoMain.find('.good-thumb img').attr('src', data.pics[0].src);
// }
// });
//});
// });
productList.addHandler('MouseEnter', function(event) {
var itemMr = 10, // list的右边距
itemMb = 35, // list的下边距
ulStr = '',
imageList,
colorList,
pic, pics,
listCount,
i,item,
ulNum,
ulNum, ulStr,
wrapperWidth,
diffWidth,
wrapperX,
... ... @@ -178,30 +176,22 @@ exports.init = function(num) {
_from = event.target.attr('data-from') || '';
listCount = event.target.find('.goodsList').length;
pics = [];
for (i = 0 ; i < listCount ; i++) {
item = event.target.find('.goodsList').find('.list').eq(i);
event.target.find('.goodsList').find('.list').each(function() {
pic = {
url: item.attr('url'),
src: item.attr('imgUrl'),
coverImg: item.attr('cover')
url: $(this).attr('url'),
src: $(this).attr('imgUrl'),
coverImg: $(this).attr('cover')
};
//pic = {
// url: 'dasda',
// src: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/16/11/0176c310938764910f7fe5f22c450d3f00.jpg?imageView2/2/w/100/h/100',
// coverImg: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/16/11/0176c310938764910f7fe5f22c450d3f00.jpg?imageView2/2/w/100/h/100'
//};
pics.push(pic);
}
});
imageList = {
pics : pics
}
pics: pics
};
var data = imageList,
colorList = createColorList(imageList.pics, _from);
colorList = createColorList(imageList.pics, _from);
removeHtmlFn();
... ... @@ -217,9 +207,10 @@ exports.init = function(num) {
wrapperWidth = 10 + (15 + 50) * ulNum + event.targetWidth;
wrapperX = (event.targetX - 1) * (event.targetWidth + itemMr) - (parseInt(wrapperPl) + 1);
wrapperY = (event.targetY - 1) *
(event.targetHeight + itemMb) + parseInt(containerPt) - (parseInt(wrapperPt) + 1);
wrapperX = (event.targetX - 1) * (event.targetWidth + itemMr) - (parseInt(wrapperPl, 10) + 1);
wrapperY = (event.targetY - 1) * (event.targetHeight + itemMb) + parseInt(containerPt, 10) -
(parseInt(wrapperPt, 10) + 1);
// todo
// event.offsetR表示当前列表距离浏览器右侧边缘的距离
... ... @@ -252,9 +243,6 @@ exports.init = function(num) {
};
// 鼠标放在颜色列表上效果
$(document).on('hover', '.good-select-color li', function() {
var coverImg = $(this).find('img').attr('data-cover'),
... ...