Skip to content

Commit

Permalink
根据浏览器UA动态调整代码块copy按钮位置。
Browse files Browse the repository at this point in the history
  • Loading branch information
hailaz committed Jun 27, 2019
1 parent 58a3f2b commit b79065f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions public/resource/js/document/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,13 @@ function reloadMainMarkdown() {
});
//用于检测代码块是否有纵向滚动条
$(".check-scroll").each(function(){
if(hasScrolled(this ,'vertical')){
$(this).prev().find("span").css("padding","2px 24px");
var ua=navigator.userAgent;
if(hasScrolled(this ,'vertical') && ua.search("Mobile")==-1){
if(ua.search("Windows NT")!=-1){
$(this).prev().find("span").css("padding","2px 22px");
}else{
$(this).prev().find("span").css("padding","2px 16px");
}
}
});
// 生成TOC菜单
Expand Down

0 comments on commit b79065f

Please sign in to comment.