...
|
...
|
@@ -22,7 +22,7 @@ setTimeout(() => { |
|
|
var Swiper = require('yoho-swiper');
|
|
|
|
|
|
// 顶部swiper
|
|
|
new Swiper('.banner-swiper', {
|
|
|
var swiper = new Swiper('.banner-swiper', {
|
|
|
preloadImages: false,
|
|
|
lazyLoading: true,
|
|
|
lazyLoadingInPrevNext: true,
|
...
|
...
|
@@ -33,6 +33,10 @@ setTimeout(() => { |
|
|
prevButton: '.my-swiper-button-prev',
|
|
|
spaceBetween: 3
|
|
|
});
|
|
|
$(".banner-swiper").click(function() {
|
|
|
$('.banner-top').toggleClass('hover');
|
|
|
swiper.onResize();
|
|
|
})
|
|
|
}, 500);
|
|
|
|
|
|
|
...
|
...
|
@@ -281,4 +285,26 @@ setTimeout(() => { |
|
|
window.rePosFooter && window.rePosFooter();
|
|
|
});
|
|
|
}, 200);
|
|
|
//加载详情页的返回顶部按钮并注册事件
|
|
|
|
|
|
$(document).scroll(function() {
|
|
|
if($(document).scrollTop() >= $(document).height() - $(window).height() - 20) {
|
|
|
if (!$('.float-top').hasClass('animation')) {
|
|
|
var top = $('.back-to-top').offset().top - $('.float-top').offset().top + ($('.back-to-top').height()-$('.float-top').height())/2;
|
|
|
var left = $('.back-to-top').offset().left - $('.float-top').offset().left;
|
|
|
$('.float-top').addClass('animation').css({
|
|
|
'transform': 'translate('+left+'px, '+top+'px) scale(0, 0)',
|
|
|
});
|
|
|
}
|
|
|
} else if ($('.product-detail').length && $(document).scrollTop() >= $('.product-detail').offset().top) {
|
|
|
if (!$('.float-top').hasClass('hover') || $('.float-top').hasClass('animation')) {
|
|
|
$('.float-top').addClass('hover').removeClass('animation').removeAttr('style');
|
|
|
}
|
|
|
} else {
|
|
|
if ($('.float-top').hasClass('hover')) {
|
|
|
$('.float-top').removeClass('hover');
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
//加载详情页的返回顶部按钮并注册事件-end
|
|
|
}(productSkn, productId, brandId)); |
...
|
...
|
|