File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,39 @@ $.ui = $.ui || {};
1919
2020var version = $.ui.version = "1.12.1";
2121
22+ // plugins
23+ $.fn.extend({
24+ zIndex: function( zIndex ) {
25+ if ( zIndex !== undefined ) {
26+ return this.css( "zIndex", zIndex );
27+ }
28+
29+ if ( this.length ) {
30+ var elem = $( this[ 0 ] ), position, value;
31+ while ( elem.length && elem[ 0 ] !== document ) {
32+ // Ignore z-index if position is set to a value where z-index is ignored by the browser
33+ // This makes behavior of this function consistent across browsers
34+ // WebKit always returns auto if the element is positioned
35+ position = elem.css( "position" );
36+ if ( position === "absolute" || position === "relative" || position === "fixed" ) {
37+ // IE returns 0 when zIndex is not specified
38+ // other browsers return a string
39+ // we ignore the case of nested elements with an explicit value of 0
40+ // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
41+ value = parseInt( elem.css( "zIndex" ), 10 );
42+ if ( !isNaN( value ) && value !== 0 ) {
43+ return value;
44+ }
45+ }
46+ elem = elem.parent();
47+ }
48+ }
49+
50+ return 0;
51+ }
52+
53+ });
54+
2255/*!
2356 * jQuery UI Widget 1.12.1
2457 * http://jqueryui.com
You can’t perform that action at this time.
0 commit comments