...
|
...
|
@@ -37,6 +37,9 @@ setTimeout(() => { |
|
|
$('.banner-top').toggleClass('hover');
|
|
|
swiper.onResize();
|
|
|
})
|
|
|
$('.banner-top-single').click(function() {
|
|
|
$('.banner-top-single').toggleClass('hover');
|
|
|
})
|
|
|
}, 500);
|
|
|
|
|
|
|
...
|
...
|
@@ -288,14 +291,12 @@ setTimeout(() => { |
|
|
//加载详情页的返回顶部按钮并注册事件
|
|
|
|
|
|
$(document).scroll(function() {
|
|
|
if($(document).scrollTop() >= $(document).height() - $(window).height() - 20) {
|
|
|
if (!$('.float-top').hasClass('animation')) {
|
|
|
if($(document).scrollTop() >= $(document).height() - $(window).height() - 120) {
|
|
|
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');
|
...
|
...
|
|