File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,13 @@ jQuery.fn.extend({
44
44
elemdisplay [ tagName ] = display ;
45
45
}
46
46
47
- this [ i ] . style . display = jQuery . data ( this [ i ] , "olddisplay" , display ) ;
47
+ jQuery . data ( this [ i ] , "olddisplay" , display ) ;
48
+ }
49
+
50
+ // Set the display of the elements in a second loop
51
+ // to avoid the constant reflow
52
+ for ( var i = 0 , l = this . length ; i < l ; i ++ ) {
53
+ this [ i ] . style . display = jQuery . data ( this [ i ] , "olddisplay" ) ;
48
54
}
49
55
}
50
56
@@ -60,8 +66,14 @@ jQuery.fn.extend({
60
66
var old = jQuery . data ( this [ i ] , "olddisplay" ) ;
61
67
if ( ! old && old !== "none" )
62
68
jQuery . data ( this [ i ] , "olddisplay" , jQuery . css ( this [ i ] , "display" ) ) ;
69
+ }
70
+
71
+ // Set the display of the elements in a second loop
72
+ // to avoid the constant reflow
73
+ for ( var i = 0 , l = this . length ; i < l ; i ++ ) {
63
74
this [ i ] . style . display = "none" ;
64
75
}
76
+
65
77
return this ;
66
78
}
67
79
} ,
You can’t perform that action at this time.
0 commit comments