...
|
...
|
@@ -159,6 +159,96 @@ bindEvent.add(function() { |
|
|
$imgShow.attr('src', src);
|
|
|
}
|
|
|
|
|
|
function bigImgShow(src) {
|
|
|
$('#big').attr('src', src);
|
|
|
}
|
|
|
|
|
|
// 查看详情功能
|
|
|
var moveWidth = 135;
|
|
|
var w = 420;
|
|
|
var h = 560;
|
|
|
var _w = 1000;
|
|
|
var radio = w / _w;
|
|
|
var $moveObj = $('.move-object');
|
|
|
var $max = $('.max');
|
|
|
|
|
|
function move(e) {
|
|
|
var x = e.pageX - $imgShow.offset().left;
|
|
|
var y = e.pageY - $imgShow.offset().top;
|
|
|
|
|
|
var _x = x - moveWidth / 2;
|
|
|
var _y = y - moveWidth / 2;
|
|
|
|
|
|
var _maxX = w - moveWidth;
|
|
|
var _maxY = h - moveWidth;
|
|
|
|
|
|
if (_x < 0) {
|
|
|
_x = 0;
|
|
|
} else if (_x >= _maxX) {
|
|
|
_x = _maxX;
|
|
|
}
|
|
|
|
|
|
if (_y < 0) {
|
|
|
_y = 0;
|
|
|
} else if (_y >= _maxY) {
|
|
|
_y = _maxY;
|
|
|
}
|
|
|
|
|
|
var offX = _x / radio;
|
|
|
var offY = _y / radio;
|
|
|
|
|
|
$moveObj.css({
|
|
|
left: _x,
|
|
|
top: _y
|
|
|
});
|
|
|
|
|
|
$max.get(0).scrollLeft = offX;
|
|
|
$max.get(0).scrollTop = offY;
|
|
|
}
|
|
|
|
|
|
$('.move-over').mouseleave(function() {
|
|
|
$('.move-object').addClass('hide');
|
|
|
$max.addClass('hide');
|
|
|
});
|
|
|
|
|
|
$('.move-over').mousemove(function(e) {
|
|
|
if ($moveObj.hasClass('hide')) {
|
|
|
$moveObj.removeClass('hide');
|
|
|
}
|
|
|
|
|
|
if ($max.hasClass('hide')) {
|
|
|
$max.removeClass('hide');
|
|
|
}
|
|
|
|
|
|
move(e);
|
|
|
});
|
|
|
|
|
|
//促销弹出框
|
|
|
var icon = {
|
|
|
unfold: '',
|
|
|
fold: ''
|
|
|
};
|
|
|
|
|
|
$('.activity-title').click(function() {
|
|
|
$(this).toggleClass('active');
|
|
|
$('.activity-container').empty();
|
|
|
|
|
|
if ($(this).hasClass('active')) {
|
|
|
$(this).find('span').html(icon.fold);
|
|
|
|
|
|
if (!$('.activity-container').html()) {
|
|
|
$('.activity-container').append($('.activity').clone().find('li').each(function() {
|
|
|
$(this).removeClass('hide');
|
|
|
}).end());
|
|
|
}
|
|
|
|
|
|
$('.activity-container').slideDown(400);
|
|
|
} else {
|
|
|
$(this).find('span').html(icon.unfold);
|
|
|
$('.activity-container').slideUp(400);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
function getCouponAsync(cid) {
|
|
|
var uid = getUid(); // eslint-disable-line
|
|
|
|
...
|
...
|
@@ -325,7 +415,14 @@ bindEvent.add(function() { |
|
|
|
|
|
// 缩略图鼠标移入显示
|
|
|
$('#thumbs').on('mouseenter', '.thumb', function() {
|
|
|
imgShow($(this).data('shower'));
|
|
|
var $this = $(this);
|
|
|
|
|
|
imgShow($this.data('shower'));
|
|
|
bigImgShow($this.data('origin'));
|
|
|
|
|
|
if (!$this.hasClass('active')) {
|
|
|
$this.siblings('.active').removeClass('active').end().addClass('active');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// 尺码
|
...
|
...
|
|