MCPcopy Index your code
hub / github.com/hoothin/UserScripts / getWindowSize

Function getWindowSize

Picviewer CE+/dist.user.js:13611–13629  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13609
13610 //获取窗口大小.
13611 function getWindowSize(){
13612 /*
13613 //包含滚动条
13614 return {
13615 h:window.innerHeight,
13616 w:window.innerWidth,
13617 };
13618 */
13619
13620 //去除滚动条的窗口大小
13621 var de=document.documentElement;
13622 var body=getBody(document);
13623 var backCompat=document.compatMode=='BackCompat';
13624 return {
13625 h:backCompat? body.clientHeight : de.clientHeight,
13626 w:backCompat? body.clientWidth : de.clientWidth,
13627 };
13628
13629 }
13630
13631 //获取已滚动的距离
13632 function getScrolled(container){

Callers 2

initFunction · 0.70
checkUniqueImgWinFunction · 0.70

Calls 1

getBodyFunction · 0.70

Tested by

no test coverage detected