( elements, show )
| 7337 | } |
| 7338 | |
| 7339 | function showHide( elements, show ) { |
| 7340 | var elem, display, |
| 7341 | values = [], |
| 7342 | index = 0, |
| 7343 | length = elements.length; |
| 7344 | |
| 7345 | for ( ; index < length; index++ ) { |
| 7346 | elem = elements[ index ]; |
| 7347 | if ( !elem.style ) { |
| 7348 | continue; |
| 7349 | } |
| 7350 | values[ index ] = jQuery._data( elem, "olddisplay" ); |
| 7351 | if ( show ) { |
| 7352 | // Reset the inline display of this element to learn if it is |
| 7353 | // being hidden by cascaded rules or not |
| 7354 | if ( !values[ index ] && elem.style.display === "none" ) { |
| 7355 | elem.style.display = ""; |
| 7356 | } |
| 7357 | |
| 7358 | // Set elements which have been overridden with display: none |
| 7359 | // in a stylesheet to whatever the default browser style is |
| 7360 | // for such an element |
| 7361 | if ( elem.style.display === "" && isHidden( elem ) ) { |
| 7362 | values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); |
| 7363 | } |
| 7364 | } else { |
| 7365 | display = curCSS( elem, "display" ); |
| 7366 | |
| 7367 | if ( !values[ index ] && display !== "none" ) { |
| 7368 | jQuery._data( elem, "olddisplay", display ); |
| 7369 | } |
| 7370 | } |
| 7371 | } |
| 7372 | |
| 7373 | // Set the display of most of the elements in a second loop |
| 7374 | // to avoid the constant reflow |
| 7375 | for ( index = 0; index < length; index++ ) { |
| 7376 | elem = elements[ index ]; |
| 7377 | if ( !elem.style ) { |
| 7378 | continue; |
| 7379 | } |
| 7380 | if ( !show || elem.style.display === "none" || elem.style.display === "" ) { |
| 7381 | elem.style.display = show ? values[ index ] || "" : "none"; |
| 7382 | } |
| 7383 | } |
| 7384 | |
| 7385 | return elements; |
| 7386 | } |
| 7387 | |
| 7388 | jQuery.fn.extend({ |
| 7389 | css: function( name, value ) { |
no test coverage detected
searching dependent graphs…