MCPcopy Create free account
hub / github.com/frank-lam/fullstack-tutorial / actualDisplay

Function actualDisplay

notes/docsify/unpkg/gotop/jquery-2.1.0.js:5415–5430  ·  view source on GitHub ↗
( name, doc )

Source from the content-addressed store, hash-verified

5413 */
5414// Called only from within defaultDisplay
5415function actualDisplay( name, doc ) {
5416 var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
5417
5418 // getDefaultComputedStyle might be reliably used only on attached element
5419 display = window.getDefaultComputedStyle ?
5420
5421 // Use of this method is a temporary fix (more like optmization) until something better comes along,
5422 // since it was removed from specification and supported only in FF
5423 window.getDefaultComputedStyle( elem[ 0 ] ).display : jQuery.css( elem[ 0 ], "display" );
5424
5425 // We don't have any data stored on the element,
5426 // so use "detach" method as fast way to get rid of the element
5427 elem.detach();
5428
5429 return display;
5430}
5431
5432/**
5433 * Try to determine the default display value of an element

Callers 1

defaultDisplayFunction · 0.85

Calls 1

jQueryFunction · 0.85

Tested by

no test coverage detected