From 7fe1394403cdde3254d94a03667dcfa523a7498d Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 2 Sep 2016 16:34:33 +0800 Subject: [PATCH] =?UTF-8?q?ios=E8=87=AA=E5=8A=A8=E5=AE=9A=E4=BD=8D?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wechat/directives/iphone_recognize.js | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/public/javascripts/wechat/directives/iphone_recognize.js b/public/javascripts/wechat/directives/iphone_recognize.js index f3b167b96..27462c7f0 100644 --- a/public/javascripts/wechat/directives/iphone_recognize.js +++ b/public/javascripts/wechat/directives/iphone_recognize.js @@ -9,24 +9,28 @@ app.directive('iphoneRecognize',["$timeout",function(timer){ timer(function(){ var contentHeight = $(".post-container").height(); var toBottom = function(){ - element.css({"position":"relative","padding":"1px 0"}); - $(".post-wrapper").css("marginBottom","0"); - $("#all_homework_reply").css("marginBottom","0"); - window.scrollTo(0,contentHeight); + element.css({"position":"absolute","padding":"1px 0","marginBottom":"-50px"}); + $(".post-wrapper").css({"marginBottom":"0","position":"relative"}); + $("#all_homework_reply,#all_blog_reply,#all_course_message_reply,#all_message_reply").css("marginBottom","0"); + window.scrollTo(0,contentHeight) }; - if (/ipad|iphone|mac/i.test(navigator.userAgent)){ +// if (/ipad|iphone|mac/i.test(navigator.userAgent)){ $("#postInput1").bind('focus',function(){ - toBottom(); + setTimeout(function(){ + toBottom(); + },200); }); $("#postInput1,#replyBlock").bind("click",function(){ - toBottom(); + setTimeout(function(){ + toBottom(); + },200); }); $("#postInput1").bind('blur',function(){ - element.css("position","fixed"); - $(".post-wrapper").css("marginBottom","10px"); - $("#all_homework_reply").css("marginBottom","50px"); + element.css({"position":"fixed","marginBottom":"0"}); + $(".post-wrapper").css({"marginBottom":"10px","position":""}); + $("#all_homework_reply,#all_blog_reply,#all_course_message_reply,#all_message_reply").css("marginBottom","52px"); }); - } +// } }) } }