...
|
...
|
@@ -17,19 +17,13 @@ var $ = require('jquery'), |
|
|
trendTopicSwiper,
|
|
|
goodsSwiper;
|
|
|
|
|
|
var requestFrame,
|
|
|
thisFunc,
|
|
|
start = 0,
|
|
|
i,
|
|
|
var start = 0,
|
|
|
swiperClass,
|
|
|
supportCss3,
|
|
|
$logotrans = $('.home-header .logo'),
|
|
|
isen = true;
|
|
|
|
|
|
var navHammer;
|
|
|
|
|
|
require('./maybe-like');
|
|
|
|
|
|
lazyLoad($('img.lazy'));
|
|
|
|
|
|
navHammer = new Hammer($('.nav-btn')[0]);
|
...
|
...
|
@@ -39,13 +33,6 @@ navHammer.on('tap', function(event) { |
|
|
$overlay.show().css('opacity', 0.3);
|
|
|
$sideNav.addClass('on');
|
|
|
|
|
|
//设置boy高宽,页面不能上下滑动
|
|
|
$('body').css({
|
|
|
height: $(window).height(),
|
|
|
width: $(window).width(),
|
|
|
overflow: 'hidden'
|
|
|
});
|
|
|
|
|
|
event.srcEvent.stopPropagation();
|
|
|
return false;
|
|
|
});
|
...
|
...
|
@@ -56,10 +43,6 @@ function hideSideBar() { |
|
|
$('.overlay').hide();
|
|
|
$('.sub-nav').removeClass('show');
|
|
|
$sideNav.removeClass('on');
|
|
|
$('body').css({
|
|
|
height: 'auto',
|
|
|
overflow: 'auto'
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -68,6 +51,11 @@ $('.overlay').on('touchstart', function(e) { |
|
|
return false;
|
|
|
});
|
|
|
|
|
|
//禁止在侧边栏可以上下滚动
|
|
|
$('.side-nav').on('touchmove', function() {
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
//点击一级导航,弹出二级导航
|
|
|
$sideNav.on('touchstart', 'li', function(e) {
|
|
|
if ($(this).find('.sub-nav').size() > 0) {
|
...
|
...
|
@@ -161,28 +149,6 @@ $('.category-swiper').each(function(i, index) { |
|
|
});
|
|
|
|
|
|
//logo动画
|
|
|
requestFrame = (function() {
|
|
|
var tempFunc = null,
|
|
|
prefixList = ['webkit', 'moz', 'ms'];
|
|
|
|
|
|
for (i = 0; i < prefixList.length; i++) {
|
|
|
thisFunc = prefixList[i] + 'RequestAnimationFrame';
|
|
|
if (window[thisFunc]) {
|
|
|
supportCss3 = true;
|
|
|
tempFunc = thisFunc;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (supportCss3) {
|
|
|
return function(callback) {
|
|
|
window[tempFunc](callback);
|
|
|
};
|
|
|
}
|
|
|
return function(callback) {
|
|
|
window.setTimeout(callback, 67);
|
|
|
};
|
|
|
})();
|
|
|
|
|
|
function tsAnimate() {
|
|
|
start = start + 10;
|
|
|
$logotrans.css({
|
...
|
...
|
@@ -205,9 +171,7 @@ function tsAnimate() { |
|
|
if (start % 360 === 0) {
|
|
|
window.setTimeout(tsAnimate, 60 * 1000);
|
|
|
} else {
|
|
|
requestFrame(function() {
|
|
|
tsAnimate();
|
|
|
});
|
|
|
window.requestAnimationFrame(tsAnimate);
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -230,3 +194,5 @@ exports.set = function(c) { |
|
|
domain: '.m.yohobuy.com'
|
|
|
});
|
|
|
};
|
|
|
|
|
|
require('./maybe-like'); |
|
|
\ No newline at end of file |
...
|
...
|
|