# mootools/mootools-demos forked from fakedarren/mootools-demos

Fix global variable

arian committed Jun 25, 2011
1 parent 1fdd187 commit b659f4e78c9c59c81eb8d212ac7ba539dd3e2057
Showing with 9 additions and 9 deletions.
1. +4 −4 demos/Native/demo.html
2. +5 −5 demos/Native/demo.js
 @@ -11,11 +11,11 @@

Code:

Elements.implement({

equalize: function(property){
-		var sum = 0,
-			length = i = this.length;
+		var sum = 0, i, len;
+		len = i = this.length;
while (i--) sum += this[i].getDimensions()[property];
-		var average = Math.round(sum / length);
-		i = length;
+		var average = Math.round(sum / len);
+		i = len;
while (i--) this.tween(property, average);
return this;
},
 @@ -3,11 +3,11 @@ Elements.implement({ equalize: function(property){ - var sum = 0, - length = i = this.length; + var sum = 0, i, len; + len = i = this.length; while (i--) sum += this[i].getDimensions()[property]; - var average = Math.round(sum / length); - i = length; + var average = Math.round(sum / len); + i = len; while (i--) this.tween(property, average); return this; }, @@ -33,6 +33,6 @@ window.addEvent('domready', function(){ i = !i if (i) els.equalize('height'); - else els.setRandom('height', 30, 100); + else els.setRandom('height', 30, 150); }); });