Hi all,

In the .css method an array is created by:

d = ["Top","Bottom","Right","Left"];

Then it is looped through using object looping:

for ( var i in d ) {

This probably isn't a problem for most people, but we have added functions to the Array prototype, so whenever the .css method is used it dumps the text of all those functions into the CSS and bloats the code considerably.  I made the following patch and tested it. It seems to work fine:

Index: jquery.js
===================================================================
--- jquery.js    (revision 575)
+++ jquery.js    (working copy)
@@ -1472,7 +1472,7 @@
         if ( p == "height" || p == "width" ) {
             var old = {}, oHeight, oWidth, d = ["Top","Bottom","Right","Left"];
 
-            for ( var i in d ) {
+            for ( var i = 0; i < d.length; i++ ) {
                 old["padding" + d[i]] = 0;
                 old["border" + d[i] + "Width"] = 0;
             }

Thanks,
Brendan
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to