iphone定位js
This commit is contained in:
parent
a66ecf6c28
commit
a467338161
|
@ -25,7 +25,7 @@
|
|||
<div ng-if="blog.praise_count && !blog.has_praise" ng-click="addPraise(blog);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{blog.praise_count}}</span></div>
|
||||
<div ng-if="blog.has_praise" ng-click="decreasePraise(blog);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{blog.praise_count}}</span></div>
|
||||
</div>
|
||||
<div class="fr mr25 f13" input-focus>
|
||||
<div id="replyBlock" class="fr mr25 f13" input-focus>
|
||||
<a ng-if="!blog.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
|
||||
<a ng-if="blog.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{blog.comment_count}}</span></a>
|
||||
</div>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<div ng-if="discussion.praise_count && !discussion.has_praise" ng-click="addPraise(discussion);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{discussion.praise_count}}</span></div>
|
||||
<div ng-if="discussion.has_praise" ng-click="decreasePraise(discussion);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{discussion.praise_count}}</span></div>
|
||||
</div>
|
||||
<div class="fr mr25 f13" input-focus>
|
||||
<div id="replyBlock" class="fr mr25 f13" input-focus>
|
||||
<a ng-if="!discussion.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
|
||||
<a ng-if="discussion.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{discussion.comment_count}}</span></a>
|
||||
</div>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<div ng-if="news.praise_count && !news.has_praise" ng-click="addPraise(news);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{news.praise_count}}</span></div>
|
||||
<div ng-if="news.has_praise" ng-click="decreasePraise(news);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{news.praise_count}}</span></div>
|
||||
</div>
|
||||
<div class="fr mr25 f13" input-focus>
|
||||
<div id="replyBlock" class="fr mr25 f13" input-focus>
|
||||
<a ng-if="!news.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
|
||||
<a ng-if="news.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{news.comment_count}}</span></a>
|
||||
</div>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<div ng-if="homework.praise_count && !homework.has_praise" ng-click="addPraise(homework);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{homework.praise_count}}</span></div>
|
||||
<div ng-if="homework.has_praise" ng-click="decreasePraise(homework);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{homework.praise_count}}</span></div>
|
||||
</div>
|
||||
<div class="fr mr25 f13" input-focus>
|
||||
<div id="replyBlock" class="fr mr25 f13" input-focus>
|
||||
<a ng-if="!homework.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
|
||||
<a ng-if="homework.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{homework.comment_count}}</span></a>
|
||||
</div>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<div ng-if="issue.praise_count && !issue.has_praise" ng-click="addPraise(discussion);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{issue.praise_count}}</span></div>
|
||||
<div ng-if="issue.has_praise" ng-click="decreasePraise(issue);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{issue.praise_count}}</span></div>
|
||||
</div>
|
||||
<div class="fr mr25 f13" input-focus>
|
||||
<div id="replyBlock" class="fr mr25 f13" input-focus>
|
||||
<a ng-if="!issue.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
|
||||
<a ng-if="issue.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{issue.comment_count}}</span></a>
|
||||
</div>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<div ng-if="message.praise_count && !message.has_praise" ng-click="addPraise(message);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{message.praise_count}}</span></div>
|
||||
<div ng-if="message.has_praise" ng-click="decreasePraise(message);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{message.praise_count}}</span></div>
|
||||
</div>
|
||||
<div class="fr mr25 f13" input-focus>
|
||||
<div id="replyBlock" class="fr mr25 f13" input-focus>
|
||||
<a ng-if="!message.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
|
||||
<a ng-if="message.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{message.comment_count}}</span></a>
|
||||
</div>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<div ng-if="discussion.praise_count && !discussion.has_praise" ng-click="addPraise(discussion);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{discussion.praise_count}}</span></div>
|
||||
<div ng-if="discussion.has_praise" ng-click="decreasePraise(discussion);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{discussion.praise_count}}</span></div>
|
||||
</div>
|
||||
<div class="fr mr25 f13" input-focus>
|
||||
<div id="replyBlock" class="fr mr25 f13" input-focus>
|
||||
<a ng-if="!discussion.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
|
||||
<a ng-if="discussion.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{discussion.comment_count}}</span></a>
|
||||
</div>
|
||||
|
|
|
@ -7,21 +7,26 @@ app.directive('iphoneRecognize',["$timeout",function(timer){
|
|||
scope: {},
|
||||
link: function(scope, element){
|
||||
timer(function(){
|
||||
var userAgent = navigator.userAgent;
|
||||
var contentHeight = $(".post-container").height();
|
||||
if (/ipad|iphone|mac/i.test(navigator.userAgent)){
|
||||
$("#postInput1").bind('focus',function(){
|
||||
var toBottom = function(){
|
||||
element.css({"position":"relative","padding":"1px 0"});
|
||||
$(".post-wrapper").css("margin-bottom","0");
|
||||
$("#all_homework_reply").css("margin-bottom","0");
|
||||
$(".post-wrapper").css("marginBottom","0");
|
||||
$("#all_homework_reply").css("marginBottom","0");
|
||||
window.scrollTo(0,contentHeight);
|
||||
});
|
||||
$("#postInput1").bind('blur',function(){
|
||||
element.css("position","fixed");
|
||||
$(".post-wrapper").css("margin-bottom","10px");
|
||||
$("#all_homework_reply").css("margin-bottom","50px");
|
||||
});
|
||||
}
|
||||
}
|
||||
if (/ipad|iphone|mac/i.test(navigator.userAgent)){
|
||||
$("#postInput1").bind('focus',function(){
|
||||
toBottom();
|
||||
});
|
||||
$("#postInput1,#replyBlock").bind("click",function(){
|
||||
toBottom();
|
||||
});
|
||||
$("#postInput1").bind('blur',function(){
|
||||
element.css("position","fixed");
|
||||
$(".post-wrapper").css("marginBottom","10px");
|
||||
$("#all_homework_reply").css("marginBottom","50px");
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue