MCPcopy Create free account
hub / github.com/unconed/TermKit / getWH

Function getWH

HTML/jquery.js:6543–6565  ·  view source on GitHub ↗
( elem, name, extra )

Source from the content-addressed store, hash-verified

6541curCSS = getComputedStyle || currentStyle;
6542
6543function getWH( elem, name, extra ) {
6544 var which = name === "width" ? cssWidth : cssHeight,
6545 val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
6546
6547 if ( extra === "border" ) {
6548 return val;
6549 }
6550
6551 jQuery.each( which, function() {
6552 if ( !extra ) {
6553 val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0;
6554 }
6555
6556 if ( extra === "margin" ) {
6557 val += parseFloat(jQuery.css( elem, "margin" + this )) || 0;
6558
6559 } else {
6560 val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0;
6561 }
6562 });
6563
6564 return val;
6565}
6566
6567if ( jQuery.expr && jQuery.expr.filters ) {
6568 jQuery.expr.filters.hidden = function( elem ) {

Callers 1

jquery.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected