...
|
...
|
@@ -8,6 +8,8 @@ var Swiper = require('yoho-swiper'); |
|
|
var yas = require('../common/data-yas');
|
|
|
var $arriveList = $('.new-arrive-list');
|
|
|
var $goodInfo = $arriveList.find('.good-info');
|
|
|
var $fixedArea = $('.fixed-area');
|
|
|
var fixedAreaTop = $fixedArea.offset() ? $fixedArea.offset().top : 0;
|
|
|
|
|
|
require('../common');
|
|
|
require('../plugins/slider');
|
...
|
...
|
@@ -97,6 +99,20 @@ function getProData($good) { |
|
|
return goodObj;
|
|
|
}
|
|
|
|
|
|
function fixAreaTop(scrollTop) {
|
|
|
|
|
|
if (scrollTop > fixedAreaTop) {
|
|
|
$fixedArea.css({
|
|
|
position: 'fixed',
|
|
|
top: 0
|
|
|
});
|
|
|
} else {
|
|
|
$fixedArea.css({
|
|
|
position: 'static',
|
|
|
top: 0
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
new Swiper('.rec-swiper', {
|
|
|
pagination: '.swiper-pagination',
|
|
|
paginationClickable: true,
|
...
|
...
|
@@ -122,6 +138,12 @@ lazyLoad($('img.lazy')); |
|
|
|
|
|
require('./detail/latest-walk'); // 最近浏览
|
|
|
|
|
|
$(window).on('scroll', function() {
|
|
|
var scrollTop = $(this).scrollTop();
|
|
|
|
|
|
fixAreaTop(scrollTop);
|
|
|
});
|
|
|
|
|
|
$(document).pjax('.foot-pager .pager > a, .catagory-navs li.active > a', '#pjax-container', {
|
|
|
timeout: 2000
|
|
|
});
|
...
|
...
|
@@ -176,6 +198,8 @@ $(function() { |
|
|
if (brandNum <= 6) {
|
|
|
$brandSwiper.find('.prev,.next').addClass('hide');
|
|
|
}
|
|
|
|
|
|
fixAreaTop($(this).scrollTop());
|
|
|
});
|
|
|
|
|
|
$(function() {
|
...
|
...
|
@@ -220,7 +244,7 @@ $(function() { |
|
|
LIST: getProListData()
|
|
|
}]
|
|
|
};
|
|
|
|
|
|
|
|
|
$bannerSlider.each(function() {
|
|
|
var $a = $(this),
|
|
|
index = $a.parent().index();
|
...
|
...
|
|