Skip to content

Commit ccd55b3

Browse files
committed
Update JiandanHero.user.js
1 parent 02795d7 commit ccd55b3

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

JiandanHero/JiandanHero.user.js

+13-5
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// @description:en Tools for jandan.net
1010
// @description:zh-TW 為煎蛋jandan.net提供左右方向鍵快捷翻頁、上下方向鍵快捷切圖、鼠標懸停顯示大圖、屏蔽指定用戶發言等功能
1111
// @author hoothin
12-
// @include http*://jandan.net/*
13-
// @include http*://i.jandan.net/*
12+
// @match http*://jandan.net/*
13+
// @match http*://i.jandan.net/*
1414
// @grant GM_setValue
1515
// @grant GM_getValue
1616
// @grant GM_deleteValue
@@ -403,10 +403,18 @@
403403
}else{
404404
top-=imgHeight;
405405
}
406-
if(left+imgWidth>document.documentElement.clientWidth){
407-
left=document.documentElement.clientWidth-imgWidth;
406+
if(left>document.documentElement.clientWidth/2){
407+
if(left+imgWidth>document.documentElement.clientWidth){
408+
left=document.documentElement.clientWidth-imgWidth;
409+
}
410+
left+=10;
411+
}else{
412+
left=left-imgWidth;
413+
if(left<0){
414+
left=0;
415+
}else left-=10;
408416
}
409-
bigImg.style.left=left+10+"px";
417+
bigImg.style.left=left+"px";
410418
bigImg.style.top=top+"px";
411419
}
412420
GM_addStyle(`

0 commit comments

Comments
 (0)