|
@@ -28,8 +28,6 @@ var requestFrame, |
|
@@ -28,8 +28,6 @@ var requestFrame, |
28
|
|
28
|
|
29
|
var navHammer;
|
29
|
var navHammer;
|
30
|
|
30
|
|
31
|
-require('./maybe-like');
|
|
|
32
|
-
|
|
|
33
|
lazyLoad($('img.lazy'));
|
31
|
lazyLoad($('img.lazy'));
|
34
|
|
32
|
|
35
|
navHammer = new Hammer($('.nav-btn')[0]);
|
33
|
navHammer = new Hammer($('.nav-btn')[0]);
|
|
@@ -39,13 +37,6 @@ navHammer.on('tap', function(event) { |
|
@@ -39,13 +37,6 @@ navHammer.on('tap', function(event) { |
39
|
$overlay.show().css('opacity', 0.3);
|
37
|
$overlay.show().css('opacity', 0.3);
|
40
|
$sideNav.addClass('on');
|
38
|
$sideNav.addClass('on');
|
41
|
|
39
|
|
42
|
- //设置boy高宽,页面不能上下滑动
|
|
|
43
|
- $('body').css({
|
|
|
44
|
- height: $(window).height(),
|
|
|
45
|
- width: $(window).width(),
|
|
|
46
|
- overflow: 'hidden'
|
|
|
47
|
- });
|
|
|
48
|
-
|
|
|
49
|
event.srcEvent.stopPropagation();
|
40
|
event.srcEvent.stopPropagation();
|
50
|
return false;
|
41
|
return false;
|
51
|
});
|
42
|
});
|
|
@@ -56,10 +47,6 @@ function hideSideBar() { |
|
@@ -56,10 +47,6 @@ function hideSideBar() { |
56
|
$('.overlay').hide();
|
47
|
$('.overlay').hide();
|
57
|
$('.sub-nav').removeClass('show');
|
48
|
$('.sub-nav').removeClass('show');
|
58
|
$sideNav.removeClass('on');
|
49
|
$sideNav.removeClass('on');
|
59
|
- $('body').css({
|
|
|
60
|
- height: 'auto',
|
|
|
61
|
- overflow: 'auto'
|
|
|
62
|
- });
|
|
|
63
|
}
|
50
|
}
|
64
|
}
|
51
|
}
|
65
|
|
52
|
|
|
@@ -68,6 +55,11 @@ $('.overlay').on('touchstart', function(e) { |
|
@@ -68,6 +55,11 @@ $('.overlay').on('touchstart', function(e) { |
68
|
return false;
|
55
|
return false;
|
69
|
});
|
56
|
});
|
70
|
|
57
|
|
|
|
58
|
+//禁止在侧边栏可以上下滚动
|
|
|
59
|
+$('.side-nav').on('touchmove', function() {
|
|
|
60
|
+ return false;
|
|
|
61
|
+});
|
|
|
62
|
+
|
71
|
//点击一级导航,弹出二级导航
|
63
|
//点击一级导航,弹出二级导航
|
72
|
$sideNav.on('touchstart', 'li', function(e) {
|
64
|
$sideNav.on('touchstart', 'li', function(e) {
|
73
|
if ($(this).find('.sub-nav').size() > 0) {
|
65
|
if ($(this).find('.sub-nav').size() > 0) {
|
|
@@ -161,28 +153,6 @@ $('.category-swiper').each(function(i, index) { |
|
@@ -161,28 +153,6 @@ $('.category-swiper').each(function(i, index) { |
161
|
});
|
153
|
});
|
162
|
|
154
|
|
163
|
//logo动画
|
155
|
//logo动画
|
164
|
-requestFrame = (function() {
|
|
|
165
|
- var tempFunc = null,
|
|
|
166
|
- prefixList = ['webkit', 'moz', 'ms'];
|
|
|
167
|
-
|
|
|
168
|
- for (i = 0; i < prefixList.length; i++) {
|
|
|
169
|
- thisFunc = prefixList[i] + 'RequestAnimationFrame';
|
|
|
170
|
- if (window[thisFunc]) {
|
|
|
171
|
- supportCss3 = true;
|
|
|
172
|
- tempFunc = thisFunc;
|
|
|
173
|
- }
|
|
|
174
|
- }
|
|
|
175
|
-
|
|
|
176
|
- if (supportCss3) {
|
|
|
177
|
- return function(callback) {
|
|
|
178
|
- window[tempFunc](callback);
|
|
|
179
|
- };
|
|
|
180
|
- }
|
|
|
181
|
- return function(callback) {
|
|
|
182
|
- window.setTimeout(callback, 67);
|
|
|
183
|
- };
|
|
|
184
|
-})();
|
|
|
185
|
-
|
|
|
186
|
function tsAnimate() {
|
156
|
function tsAnimate() {
|
187
|
start = start + 10;
|
157
|
start = start + 10;
|
188
|
$logotrans.css({
|
158
|
$logotrans.css({
|
|
@@ -205,9 +175,7 @@ function tsAnimate() { |
|
@@ -205,9 +175,7 @@ function tsAnimate() { |
205
|
if (start % 360 === 0) {
|
175
|
if (start % 360 === 0) {
|
206
|
window.setTimeout(tsAnimate, 60 * 1000);
|
176
|
window.setTimeout(tsAnimate, 60 * 1000);
|
207
|
} else {
|
177
|
} else {
|
208
|
- requestFrame(function() {
|
|
|
209
|
- tsAnimate();
|
|
|
210
|
- });
|
178
|
+ window.requestAnimationFrame(tsAnimate);
|
211
|
}
|
179
|
}
|
212
|
}
|
180
|
}
|
213
|
}
|
181
|
}
|
|
@@ -230,3 +198,5 @@ exports.set = function(c) { |
|
@@ -230,3 +198,5 @@ exports.set = function(c) { |
230
|
domain: '.m.yohobuy.com'
|
198
|
domain: '.m.yohobuy.com'
|
231
|
});
|
199
|
});
|
232
|
};
|
200
|
};
|
|
|
201
|
+
|
|
|
202
|
+require('./maybe-like'); |