Authored by htoooth

add fd

... ... @@ -29,7 +29,16 @@
{{/ isPresell}}
{{/ tags}}
</div>
<img id="img-show" class="img-show" src="{{img}}">
<div id="min-img" class="position:relation;">
<img id="img-show" class="img-show" src="{{img}}">
<div class="move-object hide"></div>
</div>
<div id="max" class="max">
<img src="" class="" src="">
</div>
<div class="share-row"><span class="title pull-left">分享:</span> {{> common/share }} </div>
</div>
<div id="thumbs" class="pull-right thumbs">
... ...
... ... @@ -158,6 +158,55 @@ bindEvent.add(function() {
$imgShow.attr('src', src);
}
var moveWidth = 135;
var w = 420;
var h = 560;
var _w = 1000;
var radio = w / _w;
var $moveObj = $('.move-object');
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 _rx = x + moveWidth / 2 ;
var _ry = y + moveWidth / 2 ;
if (_y < 0) {
_y = 0;
} else if (_y >= _ry) {
_y = _maxY;
}
if (_x < 0) {
_x = 0;
} else if (_x >= _maxX) {
_x = _maxX;
}
var offX = _x / radio;
var offY = _y / radio;
$moveObj.css({
left: _x,
top: _y
});
}
$imgShow.hover(function() {
$('.move-object').removeClass('hide');
}, function() {
$('.move-object').addClass('hide');
});
$imgShow.mousemove(function(e) {
move(e);
});
function getCouponAsync(cid) {
var uid = getUid(); // eslint-disable-line
... ... @@ -526,7 +575,7 @@ bindEvent.add(function() {
});
//套餐
$('#buy-detail').click(function () {
$('#buy-detail').click(function() {
var opt = {
className: 'pkg-dialog',
closeIcon: false,
... ...
... ... @@ -2176,6 +2176,26 @@
}
}
/****放大镜****/
.move-object {
height: 135px;
width: 135px;
background: resolve("product/move.png") no-repeat;
top: 0;
right: 0;
position: absolute;
}
.max {
width: 560px;
height: 560px;
border: 1px solid red;
}
.max img {
position: absolute;
}
/****套餐弹出框***/
.pkg-dialog {
width: 500px;
... ...