Showing
1 changed file
with
13 additions
and
1 deletions
@@ -15,7 +15,8 @@ class NewHome extends Page { | @@ -15,7 +15,8 @@ class NewHome extends Page { | ||
15 | $userAvatar: $('.user-avatar'), | 15 | $userAvatar: $('.user-avatar'), |
16 | $codeSet: $('.code-set'), | 16 | $codeSet: $('.code-set'), |
17 | $resYas: $('.res-c').find('a'), | 17 | $resYas: $('.res-c').find('a'), |
18 | - $trendCode: $('.trend-code') | 18 | + $trendCode: $('.trend-code'), |
19 | + $floatTop: $('.float-top') | ||
19 | }; | 20 | }; |
20 | 21 | ||
21 | this.init(); | 22 | this.init(); |
@@ -27,9 +28,20 @@ class NewHome extends Page { | @@ -27,9 +28,20 @@ class NewHome extends Page { | ||
27 | this.swiper(); | 28 | this.swiper(); |
28 | this.showTrend(); | 29 | this.showTrend(); |
29 | this.autoScroll(); | 30 | this.autoScroll(); |
31 | + this.backToTop(); | ||
30 | window.reMarginFooter('.footer-tab'); | 32 | window.reMarginFooter('.footer-tab'); |
31 | } | 33 | } |
32 | 34 | ||
35 | + backToTop() { | ||
36 | + $(document).scroll(() => { | ||
37 | + if (($(document).scrollTop() >= 120)) { | ||
38 | + this.selector.$floatTop.addClass('hover'); | ||
39 | + } else { | ||
40 | + this.selector.$floatTop.removeClass('hover'); | ||
41 | + } | ||
42 | + }); | ||
43 | + } | ||
44 | + | ||
33 | autoScroll() { | 45 | autoScroll() { |
34 | new AutoScroll( | 46 | new AutoScroll( |
35 | { | 47 | { |
-
Please register or login to post a comment