|
@@ -5,10 +5,12 @@ |
|
@@ -5,10 +5,12 @@ |
5
|
*/
|
5
|
*/
|
6
|
|
6
|
|
7
|
var $ = require('jquery'),
|
7
|
var $ = require('jquery'),
|
|
|
8
|
+ Hammer = require('hammer'),
|
8
|
tip = require('../plugin/tip'),
|
9
|
tip = require('../plugin/tip'),
|
9
|
lazyLoad = require('yoho.lazyload');
|
10
|
lazyLoad = require('yoho.lazyload');
|
10
|
|
11
|
|
11
|
-var winH = $(window).height(),
|
12
|
+var navHammer,
|
|
|
13
|
+ winH = $(window).height(),
|
12
|
loadMoreH = $('#load-more').height(),
|
14
|
loadMoreH = $('#load-more').height(),
|
13
|
$goodList = $('#goods-list'),
|
15
|
$goodList = $('#goods-list'),
|
14
|
loading = false,
|
16
|
loading = false,
|
|
@@ -35,8 +37,11 @@ if (kidsType) { |
|
@@ -35,8 +37,11 @@ if (kidsType) { |
35
|
|
37
|
|
36
|
$curNav = $navList.children('.focus');
|
38
|
$curNav = $navList.children('.focus');
|
37
|
|
39
|
|
38
|
-$('#maybe-like-nav').delegate('li', 'tap', function() {
|
|
|
39
|
- var $this = $(this),
|
40
|
+navHammer = new Hammer($navList[0]);
|
|
|
41
|
+navHammer.on('tap', function(e) {
|
|
|
42
|
+ var $this = $(e.target).closest('li'),
|
|
|
43
|
+//$('#maybe-like-nav').delegate('li', 'touchstart', function() {
|
|
|
44
|
+// var $this = $(this),
|
40
|
$goods = $('.goods-list'),
|
45
|
$goods = $('.goods-list'),
|
41
|
$content;
|
46
|
$content;
|
42
|
|
47
|
|
|
@@ -59,9 +64,18 @@ $('#maybe-like-nav').delegate('li', 'tap', function() { |
|
@@ -59,9 +64,18 @@ $('#maybe-like-nav').delegate('li', 'tap', function() { |
59
|
$(document).trigger('scroll'); //Trigger lazyLoad
|
64
|
$(document).trigger('scroll'); //Trigger lazyLoad
|
60
|
});
|
65
|
});
|
61
|
|
66
|
|
|
|
67
|
+$('.maybe-like p').on('touchstart', function (e) {
|
|
|
68
|
+ search();
|
|
|
69
|
+});
|
|
|
70
|
+
|
62
|
//srcoll to load more
|
71
|
//srcoll to load more
|
63
|
$(window).scroll(function () {
|
72
|
$(window).scroll(function () {
|
64
|
if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH - 50) {
|
73
|
if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH - 50) {
|
|
|
74
|
+ search();
|
|
|
75
|
+ }
|
|
|
76
|
+});
|
|
|
77
|
+
|
|
|
78
|
+function search() {
|
65
|
if (loading) {
|
79
|
if (loading) {
|
66
|
return;
|
80
|
return;
|
67
|
}
|
81
|
}
|
|
@@ -120,6 +134,4 @@ $(window).scroll(function () { |
|
@@ -120,6 +134,4 @@ $(window).scroll(function () { |
120
|
loading = false;
|
134
|
loading = false;
|
121
|
}
|
135
|
}
|
122
|
});
|
136
|
});
|
123
|
- }
|
|
|
124
|
-
|
|
|
125
|
-}); |
|
|
|
|
137
|
+} |