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

Function getWindowSize

FlashViewer-HTML5 Video/flashViewer.user.js:267–285  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

265
266 //获取窗口大小.
267 function getWindowSize() {
268/*
269 //包含滚动条
270 return {
271 h:window.innerHeight,
272 w:window.innerWidth,
273 };
274*/
275
276 //去除滚动条的窗口大小
277 var de = document.documentElement;
278 var body = document.body;
279 var backCompat = document.compatMode == 'BackCompat';
280 return {
281 height: backCompat? body.clientHeight : de.clientHeight,
282 width: backCompat? body.clientWidth : de.clientWidth,
283 };
284
285 };
286
287 //获取已滚动的距离
288 function getScrolled(container) {

Callers 2

fitScreenFunction · 0.70
contentScriptFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected