...
|
...
|
@@ -196,10 +196,10 @@ function shopNavData() { |
|
|
// return;
|
|
|
}
|
|
|
|
|
|
$('.shop-nav').html(navString);
|
|
|
$('.shop-area').html(navString);
|
|
|
|
|
|
// 导航滑动效果
|
|
|
navSwiper = new Swiper('.shop-nav', {
|
|
|
navSwiper = new Swiper('.shop-area', {
|
|
|
grabCursor: true,
|
|
|
slidesPerView: 'auto',
|
|
|
slideElement: 'li'
|
...
|
...
|
@@ -218,10 +218,19 @@ function shopNavData() { |
|
|
shopListData($('.shop-nav').find('li').eq(0).data('type'));
|
|
|
}
|
|
|
|
|
|
$(window).on('scroll touchmove touchstart touchend', function() {
|
|
|
if ($(window).scrollTop() > $('.shop-nav')[0].offsetTop) {
|
|
|
$('.shop-area').addClass('fixer');
|
|
|
} else {
|
|
|
$('.shop-area').removeClass('fixer');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// 导航点击事件
|
|
|
$('.shop-nav').find('li').on('click', function() {
|
|
|
var $this = $(this),
|
|
|
tabName = $this.data('type');
|
|
|
tabName = $this.data('type'),
|
|
|
$top = $('.shop-nav')[0].offsetTop;
|
|
|
|
|
|
if ($this.hasClass('active')) {
|
|
|
stoping = true;
|
...
|
...
|
@@ -232,6 +241,10 @@ function shopNavData() { |
|
|
shopListData(tabName, stoping);
|
|
|
|
|
|
$this.addClass('active').siblings().removeClass('active');
|
|
|
|
|
|
if ($('.shop-area').hasClass('fixer')) {
|
|
|
$(window).scrollTop($top);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
},
|
...
|
...
|
|