Showing
3 changed files
with
9 additions
and
6 deletions
framework @ 75bbc3b0
@@ -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'), |
@@ -129,7 +130,8 @@ function reMarginFooter(fixedElement) { | @@ -129,7 +130,8 @@ function reMarginFooter(fixedElement) { | ||
129 | (function() { | 130 | (function() { |
130 | var $op = $footer.children('.op-row'); | 131 | var $op = $footer.children('.op-row'); |
131 | 132 | ||
132 | - var user = getUser(); | 133 | + var user = getUser(), |
134 | + goTopHammer; | ||
133 | 135 | ||
134 | rePosFooter(); //计算底部位置 | 136 | rePosFooter(); //计算底部位置 |
135 | 137 | ||
@@ -150,9 +152,10 @@ function reMarginFooter(fixedElement) { | @@ -150,9 +152,10 @@ function reMarginFooter(fixedElement) { | ||
150 | '<a href="http://m.yohobuy.com/passport/signout/index?token=' + user[3] + '">退出</a>' | 152 | '<a href="http://m.yohobuy.com/passport/signout/index?token=' + user[3] + '">退出</a>' |
151 | ); | 153 | ); |
152 | } | 154 | } |
153 | - | ||
154 | - $op.find('.back-to-top').on('touchend', function() { | 155 | + goTopHammer = new Hammer($op.find('.back-to-top')[0]); |
156 | + goTopHammer.on('tap', function(e) { | ||
155 | $(window).scrollTop(0); | 157 | $(window).scrollTop(0); |
158 | + e.srcEvent.preventDefault(); | ||
156 | return false; | 159 | return false; |
157 | }); | 160 | }); |
158 | $footer.removeClass('hide'); | 161 | $footer.removeClass('hide'); |
@@ -15,7 +15,7 @@ function downLoadApp() { | @@ -15,7 +15,7 @@ function downLoadApp() { | ||
15 | var appUrl = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445'; | 15 | var appUrl = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445'; |
16 | var clickedAt = new Date(); | 16 | var clickedAt = new Date(); |
17 | 17 | ||
18 | - setTimeout(function () { | 18 | + setTimeout(function() { |
19 | if ((new Date()) - clickedAt < 2000) { | 19 | if ((new Date()) - clickedAt < 2000) { |
20 | window.location = appUrl; | 20 | window.location = appUrl; |
21 | } | 21 | } |
-
Please register or login to post a comment