Authored by lijing

优化js

... ... @@ -23,6 +23,18 @@ require('activity/trend/trend.page.css');
require('activity/trend/share');
require('activity/trend/map');
function autoScroll(thisPo) {
$navUl.find('.nav-item:eq(' + thisPo + ')').addClass('active').siblings('li').removeClass('active');
if (thisPo >= 2) {
// 倒数三个不触发效果
if ((sNum - thisPo) >= 3) {
myScroll.scrollTo((0 - (thisPo - 2) * sWidth), 0, 400);
}
}
}
$(
function() {
... ... @@ -519,7 +531,7 @@ $(
$navUl.removeClass('srolling');
var thisPo = Math.ceil((0 - myScroll.x) / sWidth + 1.5);
indexAct.autoScroll(thisPo);
autoScroll(thisPo);
indexAct.getTimeList();
}
});
... ... @@ -530,7 +542,7 @@ $(
if (!$(this).hasClass('disable')) {
var thisPo = $(this).index();
indexAct.autoScroll(thisPo);
autoScroll(thisPo);
indexAct.getTimeList();
}
});
... ...
... ... @@ -244,17 +244,6 @@ function checkSubmit() {
}
}
function autoScroll(thisPo) {
$navUl.find('.nav-item:eq(' + thisPo + ')').addClass('active').siblings('li').removeClass('active');
if (thisPo >= 2) {
// 倒数三个不触发效果
if ((sNum - thisPo) >= 3) {
myScroll.scrollTo((0 - (thisPo - 2) * sWidth), 0, 400);
}
}
}
function diaHide() {
$('#dialog-wrapper').hide();
}
... ... @@ -379,7 +368,6 @@ module.exports = {
clearCookieArr: clearCookieArr,
formatDate: formatDate,
checkSubmit: checkSubmit,
autoScroll: autoScroll,
submitDia: submitDia,
orderSubmit: orderSubmit,
getAbleTime: getAbleTime,
... ...