File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33// @name :en Jiandan Hero
44// @name :zh-TW 煎蛋俠
55// @namespace hoothin
6- // @version 0.6
6+ // @version 0.8
77// @description 为煎蛋jandan.net提供左右方向键快捷翻页、鼠标悬停显示大图、屏蔽指定用户发言等功能
88// @description :en Tools for jandan.net
99// @description :zh-TW 為煎蛋jandan.net提供左右方向鍵快捷翻頁、鼠標懸停顯示大圖、屏蔽指定用戶發言等功能
8383 img . onmouseout = function ( e ) {
8484 document . body . removeChild ( bigImg ) ;
8585 bigImg . removeAttribute ( "height" ) ;
86+ bigImg . removeAttribute ( "width" ) ;
8687 } ;
8788 img . onmousemove = function ( e ) {
8889 left = e . clientX ;
9495 } ;
9596 }
9697 function relocBigImg ( left , top ) {
97- if ( bigImg . height > document . documentElement . clientHeight ) {
98+ var type = bigImg . height / bigImg . width > document . documentElement . clientHeight / document . documentElement . clientWidth ;
99+ if ( type && bigImg . height > document . documentElement . clientHeight ) {
98100 bigImg . height = document . documentElement . clientHeight ;
99101 }
102+ if ( ! type && bigImg . width > document . documentElement . clientWidth ) {
103+ bigImg . width = document . documentElement . clientWidth ;
104+ }
100105 if ( top + bigImg . height > document . documentElement . clientHeight ) {
101106 top = document . documentElement . clientHeight - bigImg . height ;
102107 }
You can’t perform that action at this time.
0 commit comments