MCPcopy Index your code
hub / github.com/JsAaron/jQuery / getWH

Function getWH

1.6.1/src/css.js:341–363  ·  view source on GitHub ↗
( elem, name, extra )

Source from the content-addressed store, hash-verified

339curCSS = getComputedStyle || currentStyle;
340
341function getWH( elem, name, extra ) {
342 var which = name === "width" ? cssWidth : cssHeight,
343 val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
344
345 if ( extra === "border" ) {
346 return val;
347 }
348
349 jQuery.each( which, function() {
350 if ( !extra ) {
351 val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0;
352 }
353
354 if ( extra === "margin" ) {
355 val += parseFloat(jQuery.css( elem, "margin" + this )) || 0;
356
357 } else {
358 val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0;
359 }
360 });
361
362 return val;
363}
364
365if ( jQuery.expr && jQuery.expr.filters ) {
366 jQuery.expr.filters.hidden = function( elem ) {

Callers 1

css.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected