Showing
1 changed file
with
11 additions
and
1 deletions
@@ -3,7 +3,8 @@ | @@ -3,7 +3,8 @@ | ||
3 | * @author: xuqi<qi.xu@yoho.cn> | 3 | * @author: xuqi<qi.xu@yoho.cn> |
4 | * @date: 2015/10/21 | 4 | * @date: 2015/10/21 |
5 | */ | 5 | */ |
6 | -var $ = require('jquery'); | 6 | +var $ = require('jquery'), |
7 | + Hammer = require('yoho.hammer'); | ||
7 | 8 | ||
8 | var $footer = $('#yoho-footer'), | 9 | var $footer = $('#yoho-footer'), |
9 | $yohoPage = $('.yoho-page'), | 10 | $yohoPage = $('.yoho-page'), |
@@ -155,6 +156,15 @@ function reMarginFooter(fixedElement) { | @@ -155,6 +156,15 @@ function reMarginFooter(fixedElement) { | ||
155 | $(window).scrollTop(0); | 156 | $(window).scrollTop(0); |
156 | return false; | 157 | return false; |
157 | }); | 158 | }); |
159 | + | ||
160 | + if ($op.find('.back-to-top').length > 0) { | ||
161 | + navHammer = new Hammer(document.getElementsByClassName('back-to-top')[0]); | ||
162 | + navHammer.on('tap', function(e) { | ||
163 | + $(window).scrollTop(0); | ||
164 | + return false; | ||
165 | + }); | ||
166 | + } | ||
167 | + | ||
158 | $footer.removeClass('hide'); | 168 | $footer.removeClass('hide'); |
159 | }()); | 169 | }()); |
160 | 170 |
-
Please register or login to post a comment