Authored by 李靖

增加返回顶部

... ... @@ -15,7 +15,8 @@ class NewHome extends Page {
$userAvatar: $('.user-avatar'),
$codeSet: $('.code-set'),
$resYas: $('.res-c').find('a'),
$trendCode: $('.trend-code')
$trendCode: $('.trend-code'),
$floatTop: $('.float-top')
};
this.init();
... ... @@ -27,9 +28,20 @@ class NewHome extends Page {
this.swiper();
this.showTrend();
this.autoScroll();
this.backToTop();
window.reMarginFooter('.footer-tab');
}
backToTop() {
$(document).scroll(() => {
if (($(document).scrollTop() >= 120)) {
this.selector.$floatTop.addClass('hover');
} else {
this.selector.$floatTop.removeClass('hover');
}
});
}
autoScroll() {
new AutoScroll(
{
... ...