diff --git a/public/javascripts/wechat/directives/iphone_recognize.js b/public/javascripts/wechat/directives/iphone_recognize.js index 0d435e1a2..fabba0e51 100644 --- a/public/javascripts/wechat/directives/iphone_recognize.js +++ b/public/javascripts/wechat/directives/iphone_recognize.js @@ -8,9 +8,16 @@ app.directive('iphoneRecognize',function(){ link: function(scope, element){ var userAgent = navigator.userAgent; if (/ipad|iphone|mac/i.test(navigator.userAgent)){ - element.css({"position":"relative","padding":"1px 0"}); - $(".post-wrapper").css("margin-bottom","0"); - $("#all_homework_reply").css("margin-bottom","0"); + $("#postInput1").bind('focus',function(){ + element.css({"position":"relative","padding":"1px 0"}); + $(".post-wrapper").css("margin-bottom","0"); + $("#all_homework_reply").css("margin-bottom","0"); + }); + $("#postInput1").bind('blur',function(){ + element.css("position","fixed"); + $(".post-wrapper").css("margin-bottom","10px"); + $("#all_homework_reply").css("margin-bottom","50px"); + }); } } }