40 lines
1.7 KiB
JavaScript
40 lines
1.7 KiB
JavaScript
$(document).ready(function() {
|
|
|
|
// product
|
|
setTimeout(function() {
|
|
var iew = $('.product-cover').width();
|
|
var ieh = parseFloat($('.product-cover').css('height'))-10;
|
|
var ih = 50;
|
|
if (ieh > 0) {
|
|
$('.stickers-box').css('height', ieh);
|
|
var left2 = (iew/2)-(parseFloat($('.position-2').css('width'))/2);
|
|
$('.stickers-box .position-2').css('left', left2);
|
|
$('.stickers-box .position-4').css('top', ((ieh / 2) - ih));
|
|
var left5 = (iew/2)-(parseFloat($('.position-5').css('width'))/2);
|
|
$('.stickers-box .position-5').css({
|
|
'top': ((ieh / 2) - ih),
|
|
'left': left5
|
|
});
|
|
$('.stickers-box .position-6').css('top', (ieh / 2)-ih);
|
|
var left8 = (iew/2)-(parseFloat($('.position-8').css('width'))/2);
|
|
$('.stickers-box .position-8').css('left', left8);
|
|
}
|
|
}, 500);
|
|
|
|
// product list
|
|
setTimeout(function() {
|
|
var picw = $('.thumbnail.product-thumbnail').width();
|
|
var pich = parseFloat($('.thumbnail.product-thumbnail').css('height'))-10;
|
|
var ihl = 35;
|
|
$('.stickers-box-list').css('height', pich);
|
|
$('.stickers-box-list .position-2').css('left', ((picw / 2) - ($('.position-2').width() / 2)));
|
|
$('.stickers-box-list .position-4').css('top', ((pich / 2) - ihl));
|
|
$('.stickers-box-list .position-5').css({
|
|
'top': ((pich / 2) - ihl),
|
|
'left': ((picw / 2) - ($('.position-5').width() / 2))
|
|
});
|
|
$('.stickers-box-list .position-6').css('top', (pich / 2)-ihl);
|
|
$('.stickers-box-list .position-8').css('left', ((picw / 2) - ($('.position-8').width() / 2)));
|
|
}, 500);
|
|
|
|
}); |