...
|
...
|
@@ -1819,86 +1819,6 @@ bindEvent.fire(); |
|
|
dataLoad.fn && dataLoad.fn();
|
|
|
}());
|
|
|
|
|
|
$(window).scroll(function() {
|
|
|
var sc = $(document);
|
|
|
var win = $(window);
|
|
|
var scrollStart = $('.other-infos').offset().top;
|
|
|
var scrollBottom = sc.height() - $('#after-service-switch').offset().top;
|
|
|
var scrollEnd = $('#textbox').offset().top;
|
|
|
var scrollShoppingcar = $('#block-title-head').offset().top;
|
|
|
|
|
|
if (sc.scrollTop() >= scrollStart && sc.scrollTop() <= scrollEnd) {
|
|
|
$('.shoppingCar').addClass('fixednav');
|
|
|
} else {
|
|
|
$('.shoppingCar').removeClass('fixednav');
|
|
|
}
|
|
|
|
|
|
if (sc.height() - win.height() - sc.scrollTop() <= scrollBottom) {
|
|
|
$('.shoppingCar').height(win.height() - (scrollBottom + win.height() + sc.scrollTop() - sc.height()));
|
|
|
|
|
|
} else {
|
|
|
$('.shoppingCar').height(1000);
|
|
|
}
|
|
|
|
|
|
if (sc.scrollTop() >= scrollShoppingcar) {
|
|
|
$('.shoppingCar-btn').css('display', 'block');
|
|
|
} else {
|
|
|
$('.shoppingCar-btn').css('display', 'none');
|
|
|
}
|
|
|
|
|
|
$('.getnav').each(function(i, ele) {
|
|
|
|
|
|
var data;
|
|
|
|
|
|
if ($(ele).offset().top - $(window).scrollTop() < 100) {
|
|
|
data = $(ele).data('id');
|
|
|
$('.shoppingCar-nav li:eq(' + data + ')').siblings().find('a').removeClass('fixed');
|
|
|
$('.shoppingCar-nav li:eq(' + data + ')').find('a').addClass('fixed');
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
$('.shoppingCar').on('click', '.option', function(e) {
|
|
|
e.stopPropagation();
|
|
|
|
|
|
var $this = $(this);
|
|
|
|
|
|
if ($this.hasClass('fixed')) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
$this.closest('li').siblings().find('.option').removeClass('fixed');
|
|
|
$this.addClass('fixed');
|
|
|
|
|
|
if ($this.hasClass('comment') || $this.hasClass('consult')) {
|
|
|
$.when(window.fetchComment(), window.fetchConsult(), window.fetchRecommend());
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$('.shoppingCar-btn').on('click', function() {
|
|
|
var $this = $(this);
|
|
|
var $addToCart = $('#add-to-cart');
|
|
|
|
|
|
if ($this.hasClass('disable')) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if ($this.data('gocart') === 1) {
|
|
|
window.jumpUrl($('#go-to-cart-url').attr('href'));
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (maxStock === -1) {
|
|
|
$('#sizes').children('.size-warn').removeClass('hide');
|
|
|
$('.shoppingCar-nav li:eq(0)').siblings().find('a').removeClass('fixed');
|
|
|
$('.shoppingCar-nav li:eq(0)').find('a').addClass('fixed');
|
|
|
} else {
|
|
|
$addToCart.trigger('click');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$(function() {
|
|
|
$('.bottom-tab .change').click(function() {
|
|
|
$('.img-brand-switch .next').trigger('click');
|
...
|
...
|
|