Authored by 郝肖肖

pre 获取选中的

... ... @@ -458,7 +458,7 @@ $(window).ready(function() {
setTimeout(function() {
scH = $('#scroller').outerHeight();
}, 1000);
}, 500);
myScroll.on('scroll', scrollHandler);
... ... @@ -503,6 +503,8 @@ function search(opt) {
opt.url = location.protocol + '//m.yohobuy.com/index/search/search';
}
$pre = $listNav.find('.active').eq(0);
if (!opt.nextPage) {
//筛选项变更则重置reload为true
... ... @@ -696,15 +698,9 @@ $subNav.on('touchend touchcancel', function(e) {
//筛选面板切换状态
if ($this.hasClass('active')) {
filter.hideFilter();
//点击筛选钱的active项回复active
$pre.addClass('active');
$this.removeClass('active');
myScroll && myScroll.enable();
} else {
$pre = $listNav.find('.active').eq(0);
myScroll && myScroll.scrollTo(0, -(imgH + main1oH + nav1H));
theY = imgH + main1oH + nav1H;
... ... @@ -749,7 +745,6 @@ $subNav.on('touchend touchcancel', function(e) {
// 价格/折扣切换排序状态
$this.find('.icon > .iconfont').toggleClass('cur');
$pre = $this; //更新pre为当前项
nav.reload = true; //重置reload,HTML会被替换为逆序的HTML
nav.order = nav.order === 0 ? 1 : 0; //切换排序
... ... @@ -773,8 +768,6 @@ $subNav.on('touchend touchcancel', function(e) {
} else {
$active = $subNav.find('.active');
$pre = $this; //$pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项
if ($active.hasClass('filter')) {
//若之前active项为筛选,则隐藏筛选面板
... ...