MCPcopy
hub / github.com/tdewolff/minify / getDimensions

Function getDimensions

_benchmarks/sample_jqueryui.js:1082–1110  ·  view source on GitHub ↗
( elem )

Source from the content-addressed store, hash-verified

1080}
1081
1082function getDimensions( elem ) {
1083 var raw = elem[0];
1084 if ( raw.nodeType === 9 ) {
1085 return {
1086 width: elem.width(),
1087 height: elem.height(),
1088 offset: { top: 0, left: 0 }
1089 };
1090 }
1091 if ( $.isWindow( raw ) ) {
1092 return {
1093 width: elem.width(),
1094 height: elem.height(),
1095 offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
1096 };
1097 }
1098 if ( raw.preventDefault ) {
1099 return {
1100 width: 0,
1101 height: 0,
1102 offset: { top: raw.pageY, left: raw.pageX }
1103 };
1104 }
1105 return {
1106 width: elem.outerWidth(),
1107 height: elem.outerHeight(),
1108 offset: elem.offset()
1109 };
1110}
1111
1112$.position = {
1113 scrollbarWidth: function() {

Callers 1

sample_jqueryui.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…