|
@@ -30,26 +30,15 @@ function hotrank(page, sort, tabId, notab) { |
|
@@ -30,26 +30,15 @@ function hotrank(page, sort, tabId, notab) { |
30
|
lazyLoad($('img.lazy'));
|
30
|
lazyLoad($('img.lazy'));
|
31
|
$('#yoho-footer').css('position', 'static');
|
31
|
$('#yoho-footer').css('position', 'static');
|
32
|
$('.rank-main ul li:gt(2)').find('.item-content i').removeClass('top');
|
32
|
$('.rank-main ul li:gt(2)').find('.item-content i').removeClass('top');
|
|
|
33
|
+ winH = $(window).height();
|
|
|
34
|
+ if ($('.rank-main').length !== 0) {
|
|
|
35
|
+ listTop = $('.rank-main').find('ul').offset().top;
|
|
|
36
|
+ }
|
33
|
navSwiper = new Swiper('.s-goods-nav', {
|
37
|
navSwiper = new Swiper('.s-goods-nav', {
|
34
|
grabCursor: true,
|
38
|
grabCursor: true,
|
35
|
slidesPerView: 'auto',
|
39
|
slidesPerView: 'auto',
|
36
|
slideElement: 'li'
|
40
|
slideElement: 'li'
|
37
|
});
|
41
|
});
|
38
|
-
|
|
|
39
|
- winH = $(window).height();
|
|
|
40
|
- listTop = $('.rank-main').find('ul').offset().top;
|
|
|
41
|
- $('.s-goods-nav .nav-item').each(function(index) {
|
|
|
42
|
- hotnav = new Hammer($('.s-goods-nav .nav-item')[index]);
|
|
|
43
|
- hotnav.on('tap', function(e) {
|
|
|
44
|
- var navItme = $('.s-goods-nav .nav-item').eq(index);
|
|
|
45
|
-
|
|
|
46
|
- id = navItme.data('id') ? navItme.data('id') : '';
|
|
|
47
|
- sort = navItme.data('sort') ? navItme.data('sort') : '';
|
|
|
48
|
- page = 1;
|
|
|
49
|
- notab = 1;
|
|
|
50
|
- hotrank(page, sort, id, notab);
|
|
|
51
|
- });
|
|
|
52
|
- });
|
|
|
53
|
}
|
42
|
}
|
54
|
});
|
43
|
});
|
55
|
}
|
44
|
}
|
|
@@ -67,3 +56,18 @@ $(window).scroll(function () { |
|
@@ -67,3 +56,18 @@ $(window).scroll(function () { |
67
|
|
56
|
|
68
|
});
|
57
|
});
|
69
|
hotrank(page, sort, id, notab);
|
58
|
hotrank(page, sort, id, notab);
|
|
|
59
|
+hotnav = new Hammer(document.getElementById('hotRank'));
|
|
|
60
|
+hotnav.on('tap', function (e) {
|
|
|
61
|
+ var ev = ev || window.event;
|
|
|
62
|
+ var target = ev.target || ev.srcElement;
|
|
|
63
|
+
|
|
|
64
|
+ if (target.nodeName.toLowerCase() === 'span') {
|
|
|
65
|
+ $('.s-goods-nav .nav-item').removeClass('active');
|
|
|
66
|
+ target.parentNode.className = 'active ' + target.parentNode.className;
|
|
|
67
|
+ id = target.getAttribute('data-id') ? target.getAttribute('data-id') : '';
|
|
|
68
|
+ sort = target.getAttribute('data-sort') ? target.getAttribute('data-sort') : '';
|
|
|
69
|
+ page = 1;
|
|
|
70
|
+ notab = 1;
|
|
|
71
|
+ hotrank(page, sort, id, notab);
|
|
|
72
|
+ }
|
|
|
73
|
+}) |