Merge branch 'release/1.0' of http://git.yoho.cn/fe/yoho-blk into release/1.0
Showing
2 changed files
with
23 additions
and
2 deletions
@@ -17,6 +17,19 @@ function showOrNot() { | @@ -17,6 +17,19 @@ function showOrNot() { | ||
17 | } | 17 | } |
18 | } | 18 | } |
19 | 19 | ||
20 | +function reposReturnTop() { | ||
21 | + var $top = $returnTop.parent(); | ||
22 | + | ||
23 | + if (!$top.hasClass('service-top')) { | ||
24 | + $top = $returnTop; | ||
25 | + } | ||
26 | + if ($(window).width() < 1380) { | ||
27 | + $top.addClass('for-min'); | ||
28 | + } else { | ||
29 | + $top.removeClass('for-min'); | ||
30 | + } | ||
31 | +} | ||
32 | + | ||
20 | $returnTop.click(function() { | 33 | $returnTop.click(function() { |
21 | $('html,body').animate({ | 34 | $('html,body').animate({ |
22 | scrollTop: 0 | 35 | scrollTop: 0 |
@@ -36,4 +49,10 @@ if ($returnTop.hasClass('hide')) { | @@ -36,4 +49,10 @@ if ($returnTop.hasClass('hide')) { | ||
36 | $('img').load(showOrNot); | 49 | $('img').load(showOrNot); |
37 | } | 50 | } |
38 | 51 | ||
52 | +reposReturnTop(); | ||
53 | + | ||
54 | +if ($returnTop.length) { | ||
55 | + $(window).resize(reposReturnTop); | ||
56 | +} | ||
57 | + | ||
39 | exports.returnTopShowOrNot = showOrNot; | 58 | exports.returnTopShowOrNot = showOrNot; |
-
Please register or login to post a comment