jQuery.fn.extend({
addClass: function( value ) {
var classes, elem, cur, clazz, j, finalValue,
+ proceed = typeof value === "string" && value,
i = 0,
- len = this.length,
- proceed = typeof value === "string" && value;
+ len = this.length;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
removeClass: function( value ) {
var classes, elem, cur, clazz, j, finalValue,
+ proceed = arguments.length === 0 || typeof value === "string" && value,
i = 0,
- len = this.length,
- proceed = arguments.length === 0 || typeof value === "string" && value;
+ len = this.length;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
// The value/s can optionally be executed if it's a function
var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
var i = 0,
- length = elems.length,
+ len = elems.length,
bulk = key == null;
// Sets many values
}
if ( fn ) {
- for ( ; i < length; i++ ) {
+ for ( ; i < len; i++ ) {
fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
}
}
// Gets
bulk ?
fn.call( elems ) :
- length ? fn( elems[0], key ) : emptyGet;
+ len ? fn( elems[0], key ) : emptyGet;
};
return access;
// Generate parameters to create a standard animation
function genFx( type, includeWidth ) {
var which,
- attrs = { height: type },
- i = 0;
+ i = 0,
+ attrs = { height: type };
// if we include width, step value is 1 to do all cssExpand values,
// if we don't include width, step value is 2 to skip over Left and Right
jQuery.timers = [];
jQuery.fx.tick = function() {
var timer,
- timers = jQuery.timers,
- i = 0;
+ i = 0,
+ timers = jQuery.timers;
fxNow = jQuery.now();
jQuery.fn.extend({
find: function( selector ) {
- var i,
+ var i = 0,
+ len = this.length,
ret = [],
- self = this,
- len = self.length;
+ self = this;
if ( typeof selector !== "string" ) {
return this.pushStack( jQuery( selector ).filter(function() {
- for ( i = 0; i < len; i++ ) {
+ for ( ; i < len; i++ ) {
if ( jQuery.contains( self[ i ], this ) ) {
return true;
}
}) );
}
- for ( i = 0; i < len; i++ ) {
+ i = 0;
+ for ( ; i < len; i++ ) {
jQuery.find( selector, self[ i ], ret );
}