...
|
...
|
@@ -4,9 +4,9 @@ |
|
|
* @date: 2015/7/15
|
|
|
*/
|
|
|
|
|
|
var $ = require('jquery'),
|
|
|
swiper = require('yoho-idangerous.swiper'),
|
|
|
lazyLoad = require('./common/lazyload'),
|
|
|
var $ = require('yoho.jquery'),
|
|
|
swiper = require('yoho.iswiper'),
|
|
|
lazyLoad = require('yoho.lazyload'),
|
|
|
bannerSwiper,
|
|
|
hotBrandsSwiper,
|
|
|
recommendSwiper,
|
...
|
...
|
@@ -23,6 +23,7 @@ $('.nav-btn').on('click', function(event) { |
|
|
if (!$(this).hasClass('menu-open')) {
|
|
|
$('.mobile-wrap').addClass('menu-open');
|
|
|
$('.overlay').addClass('show');
|
|
|
$('.side-nav').addClass('on');
|
|
|
//设置boy高宽,页面不能上下滑动
|
|
|
$('body').css({
|
|
|
height: $(window).height(),
|
...
|
...
|
@@ -39,6 +40,7 @@ $('.mobile-wrap').on('click', function() { |
|
|
$('.mobile-wrap').removeClass('menu-open');
|
|
|
$('.overlay').removeClass('show');
|
|
|
$('.sub-nav').removeClass('show');
|
|
|
$('.side-nav').removeClass('on');
|
|
|
$('body').css({
|
|
|
height: 'auto',
|
|
|
overflow: 'auto'
|
...
|
...
|
@@ -70,10 +72,7 @@ if ($('.banner-swiper').find('li').size() > 1) { |
|
|
autoplayDisableOnInteraction: false,
|
|
|
paginationClickable: true,
|
|
|
slideElement: 'li',
|
|
|
pagination: '.banner-top .pagination-inner',
|
|
|
onSlideChangeStart: function() {
|
|
|
lazyLoad($('.banner-swiper .swiper-slide').eq(bannerSwiper.activeIndex).find('img'));
|
|
|
}
|
|
|
pagination: '.banner-top .pagination-inner'
|
|
|
});
|
|
|
};
|
|
|
|
...
|
...
|
@@ -101,10 +100,7 @@ if ($('.trend-topic-swiper').find('li').size() > 1) { |
|
|
autoplayDisableOnInteraction: false,
|
|
|
paginationClickable: true,
|
|
|
slideElement: 'li',
|
|
|
pagination: '.trend-topic-content .pagination-inner',
|
|
|
onSlideChangeStart: function() {
|
|
|
lazyLoad($('.trend-topic-swiper .swiper-slide').eq(trendTopicSwiper.activeIndex).find('img'));
|
|
|
}
|
|
|
pagination: '.trend-topic-content .pagination-inner'
|
|
|
});
|
|
|
};
|
|
|
|
...
|
...
|
@@ -134,4 +130,57 @@ $('.back-to-top').bind('touchstart', function(e) { |
|
|
//关闭头部下载浮层
|
|
|
$('.header-download').on('click', '.close-btn', function() {
|
|
|
$(this).parent().remove();
|
|
|
}); |
|
|
\ No newline at end of file |
|
|
});
|
|
|
|
|
|
//logo动画
|
|
|
/*var requestFrame = (function() {
|
|
|
var thisFunc, prefixList = ['webkit', 'moz', 'ms'];
|
|
|
for (var i = 0; i < prefixList.length; i++) {
|
|
|
thisFunc = prefixList[i] + 'RequestAnimationFrame';
|
|
|
if (window[thisFunc]) {
|
|
|
supportCss3 = true;
|
|
|
return function(callback) {
|
|
|
window[thisFunc](callback);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return function(callback) {
|
|
|
window.setTimeout(callback, 67);
|
|
|
}
|
|
|
})();
|
|
|
var start = 0,
|
|
|
logotrans = $('.header .logo');
|
|
|
var isen = true;
|
|
|
|
|
|
function tsAnimate() {
|
|
|
start = start + 10;
|
|
|
logotrans.css({
|
|
|
"transform": 'rotateX(' + start + 'deg)',
|
|
|
"-webkit-transform": 'rotateX(' + start + 'deg)',
|
|
|
"-moz-transform": 'rotateX(' + start + 'deg)'
|
|
|
});
|
|
|
if (start / 90 % 2 == 1) { //
|
|
|
if (isen) {
|
|
|
//logotrans.css("background-image", 'url(http://static.yohobuy.com/newheader/img/logo1.png)');
|
|
|
logotrans.addClass('animate');
|
|
|
isen = false;
|
|
|
} else {
|
|
|
logotrans.removeClass('animate');
|
|
|
//logotrans.css("background-image", 'url(http://static.yohobuy.com/newheader/img/logo_e.png)');
|
|
|
isen = true;
|
|
|
}
|
|
|
}
|
|
|
if (start / 90 % 2 == 0 && start % 360 !== 0) {
|
|
|
window.setTimeout(tsAnimate, 3000);
|
|
|
} else {
|
|
|
if (start % 360 === 0) {
|
|
|
window.setTimeout(tsAnimate, 3 * 60 * 1000);
|
|
|
} else {
|
|
|
requestFrame(function() {
|
|
|
tsAnimate();
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
tsAnimate();*/ |
|
|
\ No newline at end of file |
...
|
...
|
|