|
@@ -16,7 +16,9 @@ var searchH = $('.newbrand-search').outerHeight(), |
|
@@ -16,7 +16,9 @@ var searchH = $('.newbrand-search').outerHeight(), |
16
|
headerH = $('.yoho-header').outerHeight(),
|
16
|
headerH = $('.yoho-header').outerHeight(),
|
17
|
brandSwipe = parseInt(searchH) + parseInt(headerH) - 1;
|
17
|
brandSwipe = parseInt(searchH) + parseInt(headerH) - 1;
|
18
|
|
18
|
|
19
|
-var myHammer;
|
19
|
+var myHammer, searchBtnHammer, clearTextHammer;
|
|
|
20
|
+
|
|
|
21
|
+var $rightBarCon = $('#right-bar .con').find('b').unbind();
|
20
|
|
22
|
|
21
|
swiper = new Swiper('.swiper-container', {
|
23
|
swiper = new Swiper('.swiper-container', {
|
22
|
lazyLoading: true,
|
24
|
lazyLoading: true,
|
|
@@ -52,14 +54,15 @@ if ($brandList.length > 0) { |
|
@@ -52,14 +54,15 @@ if ($brandList.length > 0) { |
52
|
});
|
54
|
});
|
53
|
}
|
55
|
}
|
54
|
|
56
|
|
55
|
-if ($('#right-bar .con').find('b').unbind()[0]) {
|
|
|
56
|
- myHammer = new Hammer($('#right-bar .con').find('b').unbind()[0]);
|
57
|
+if ($rightBarCon[0]) {
|
|
|
58
|
+ myHammer = new Hammer($rightBarCon[0]);
|
57
|
myHammer.on('tap', function(e) {
|
59
|
myHammer.on('tap', function(e) {
|
58
|
- var index = $(this).index();
|
60
|
+ var index = $rightBarCon.index();
|
59
|
|
61
|
|
60
|
if ($('.bar-' + index).size() > 0) {
|
62
|
if ($('.bar-' + index).size() > 0) {
|
61
|
document.body.scrollTop = parseInt($('.bar-' + index)[0].offsetTop) - parseInt(brandSwipe - 1);
|
63
|
document.body.scrollTop = parseInt($('.bar-' + index)[0].offsetTop) - parseInt(brandSwipe - 1);
|
62
|
}
|
64
|
}
|
|
|
65
|
+ e.srcEvent.stopPropagation();
|
63
|
});
|
66
|
});
|
64
|
}
|
67
|
}
|
65
|
|
68
|
|
|
@@ -87,19 +90,31 @@ $('#keyword').on('keyup', function() { |
|
@@ -87,19 +90,31 @@ $('#keyword').on('keyup', function() { |
87
|
$('.search-action').hide();
|
90
|
$('.search-action').hide();
|
88
|
});
|
91
|
});
|
89
|
|
92
|
|
90
|
-$('#search-btn').on('tap', function() {
|
93
|
+// $('#search-btn').on('tap', function() {
|
|
|
94
|
+// searchResult(1);
|
|
|
95
|
+// });
|
|
|
96
|
+
|
|
|
97
|
+searchBtnHammer = new Hammer($('#search-btn')[0]);
|
|
|
98
|
+searchBtnHammer.on('tap', function(e) {
|
91
|
searchResult(1);
|
99
|
searchResult(1);
|
|
|
100
|
+ e.srcEvent.stopPropagation();
|
92
|
});
|
101
|
});
|
93
|
|
102
|
|
94
|
-$('.clear-text').on('tap', function() {
|
103
|
+// $('.clear-text').on('tap', function() {
|
|
|
104
|
+// $('#keyword').val('').trigger('input');
|
|
|
105
|
+// });
|
|
|
106
|
+
|
|
|
107
|
+clearTextHammer = new Hammer($('.clear-text')[0]);
|
|
|
108
|
+clearTextHammer.on('tap', function(e) {
|
95
|
$('#keyword').val('').trigger('input');
|
109
|
$('#keyword').val('').trigger('input');
|
|
|
110
|
+ e.srcEvent.stopPropagation();
|
96
|
});
|
111
|
});
|
97
|
|
112
|
|
98
|
$('form.search-box').on('submit', function() {
|
113
|
$('form.search-box').on('submit', function() {
|
99
|
return false;
|
114
|
return false;
|
100
|
});
|
115
|
});
|
101
|
|
116
|
|
102
|
-$('.clear-history').on('tap', function() {
|
117
|
+$('.clear-history').on('touchstart', function() {
|
103
|
|
118
|
|
104
|
// setcookie('h_brands', '', {
|
119
|
// setcookie('h_brands', '', {
|
105
|
// expire: -1,
|
120
|
// expire: -1,
|