Authored by 徐祁xuqi

scroll end/start

... ... @@ -257,10 +257,8 @@ function tabChange(dom, index) {
myScroll && myScroll.refresh();
scH = $('#scroller').outerHeight();
$nav1.removeClass('fixed-top');
$nav1.removeClass('absolute');
$nav2.removeClass('fixed-top');
$nav2.removeClass('absolute');
$nav1.removeClass('fixed-top absolute');
$nav2.removeClass('fixed-top absolute');
}
if (!$nav1.hasClass('hide')) {
myScroll.scrollTo(0, 0 - imgH);
... ... @@ -280,7 +278,7 @@ myScroll.on('scroll', function() {
var tra;
if (sTop + winH > $('#scroller').height() - 0.25 * $goodsContainer.height() - 50) {
if (sTop + winH > scH - 0.25 * $goodsContainer.height() - 50) {
if ($pre !== undefined) {
search({
type: 'shop_id',
... ... @@ -381,6 +379,23 @@ myScroll.on('scroll', function() {
});
}
}
});
myScroll.on('scrollStart', function() {
// stop auto play when scroll
bannerSwiper && bannerSwiper.stopAutoplay();
multiSwiper && multiSwiper.stopAutoplay();
});
myScroll.on('scrollEnd', function() {
// start auto play when scroll end
bannerSwiper && bannerSwiper.startAutoplay();
multiSwiper && multiSwiper.startAutoplay();
$('#scroller').trigger('scroll');
});
... ... @@ -613,6 +628,8 @@ $subNav.on('touchend touchcancel', function(e) {
//点击筛选钱的active项回复active
$pre.addClass('active');
$this.removeClass('active');
myScroll.enable();
} else {
$pre = $this.siblings('.active');
... ... @@ -620,6 +637,8 @@ $subNav.on('touchend touchcancel', function(e) {
$this.addClass('active');
filter.showFilter();
myScroll.disable();
}
} else {
if ($this.hasClass('new')) {
... ... @@ -721,6 +740,8 @@ filter.initFilter({
//切换active状态到$pre上
$pre.addClass('active');
$pre.siblings('.filter').removeClass('active');
myScroll.enable();
},
missStatus: true
});
... ...