⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jquery-1.3.1.js

📁 ajaxpro
💻 JS
📖 第 1 页 / 共 5 页
字号:
			} else {				pop = parts.pop();			}			if ( pop == null ) {				pop = context;			}			Expr.relative[ cur ]( checkSet, pop, isXML(context) );		}	}	if ( !checkSet ) {		checkSet = set;	}	if ( !checkSet ) {		throw "Syntax error, unrecognized expression: " + (cur || selector);	}	if ( toString.call(checkSet) === "[object Array]" ) {		if ( !prune ) {			results.push.apply( results, checkSet );		} else if ( context.nodeType === 1 ) {			for ( var i = 0; checkSet[i] != null; i++ ) {				if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {					results.push( set[i] );				}			}		} else {			for ( var i = 0; checkSet[i] != null; i++ ) {				if ( checkSet[i] && checkSet[i].nodeType === 1 ) {					results.push( set[i] );				}			}		}	} else {		makeArray( checkSet, results );	}	if ( extra ) {		Sizzle( extra, context, results, seed );	}	return results;};Sizzle.matches = function(expr, set){	return Sizzle(expr, null, null, set);};Sizzle.find = function(expr, context, isXML){	var set, match;	if ( !expr ) {		return [];	}	for ( var i = 0, l = Expr.order.length; i < l; i++ ) {		var type = Expr.order[i], match;				if ( (match = Expr.match[ type ].exec( expr )) ) {			var left = RegExp.leftContext;			if ( left.substr( left.length - 1 ) !== "\\" ) {				match[1] = (match[1] || "").replace(/\\/g, "");				set = Expr.find[ type ]( match, context, isXML );				if ( set != null ) {					expr = expr.replace( Expr.match[ type ], "" );					break;				}			}		}	}	if ( !set ) {		set = context.getElementsByTagName("*");	}	return {set: set, expr: expr};};Sizzle.filter = function(expr, set, inplace, not){	var old = expr, result = [], curLoop = set, match, anyFound;	while ( expr && set.length ) {		for ( var type in Expr.filter ) {			if ( (match = Expr.match[ type ].exec( expr )) != null ) {				var filter = Expr.filter[ type ], found, item;				anyFound = false;				if ( curLoop == result ) {					result = [];				}				if ( Expr.preFilter[ type ] ) {					match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not );					if ( !match ) {						anyFound = found = true;					} else if ( match === true ) {						continue;					}				}				if ( match ) {					for ( var i = 0; (item = curLoop[i]) != null; i++ ) {						if ( item ) {							found = filter( item, match, i, curLoop );							var pass = not ^ !!found;							if ( inplace && found != null ) {								if ( pass ) {									anyFound = true;								} else {									curLoop[i] = false;								}							} else if ( pass ) {								result.push( item );								anyFound = true;							}						}					}				}				if ( found !== undefined ) {					if ( !inplace ) {						curLoop = result;					}					expr = expr.replace( Expr.match[ type ], "" );					if ( !anyFound ) {						return [];					}					break;				}			}		}		expr = expr.replace(/\s*,\s*/, "");		// Improper expression		if ( expr == old ) {			if ( anyFound == null ) {				throw "Syntax error, unrecognized expression: " + expr;			} else {				break;			}		}		old = expr;	}	return curLoop;};var Expr = Sizzle.selectors = {	order: [ "ID", "NAME", "TAG" ],	match: {		ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,		CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,		NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,		ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,		TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,		CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,		POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,		PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/	},	attrMap: {		"class": "className",		"for": "htmlFor"	},	attrHandle: {		href: function(elem){			return elem.getAttribute("href");		}	},	relative: {		"+": function(checkSet, part){			for ( var i = 0, l = checkSet.length; i < l; i++ ) {				var elem = checkSet[i];				if ( elem ) {					var cur = elem.previousSibling;					while ( cur && cur.nodeType !== 1 ) {						cur = cur.previousSibling;					}					checkSet[i] = typeof part === "string" ?						cur || false :						cur === part;				}			}			if ( typeof part === "string" ) {				Sizzle.filter( part, checkSet, true );			}		},		">": function(checkSet, part, isXML){			if ( typeof part === "string" && !/\W/.test(part) ) {				part = isXML ? part : part.toUpperCase();				for ( var i = 0, l = checkSet.length; i < l; i++ ) {					var elem = checkSet[i];					if ( elem ) {						var parent = elem.parentNode;						checkSet[i] = parent.nodeName === part ? parent : false;					}				}			} else {				for ( var i = 0, l = checkSet.length; i < l; i++ ) {					var elem = checkSet[i];					if ( elem ) {						checkSet[i] = typeof part === "string" ?							elem.parentNode :							elem.parentNode === part;					}				}				if ( typeof part === "string" ) {					Sizzle.filter( part, checkSet, true );				}			}		},		"": function(checkSet, part, isXML){			var doneName = "done" + (done++), checkFn = dirCheck;			if ( !part.match(/\W/) ) {				var nodeCheck = part = isXML ? part : part.toUpperCase();				checkFn = dirNodeCheck;			}			checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);		},		"~": function(checkSet, part, isXML){			var doneName = "done" + (done++), checkFn = dirCheck;			if ( typeof part === "string" && !part.match(/\W/) ) {				var nodeCheck = part = isXML ? part : part.toUpperCase();				checkFn = dirNodeCheck;			}			checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);		}	},	find: {		ID: function(match, context, isXML){			if ( typeof context.getElementById !== "undefined" && !isXML ) {				var m = context.getElementById(match[1]);				return m ? [m] : [];			}		},		NAME: function(match, context, isXML){			if ( typeof context.getElementsByName !== "undefined" && !isXML ) {				return context.getElementsByName(match[1]);			}		},		TAG: function(match, context){			return context.getElementsByTagName(match[1]);		}	},	preFilter: {		CLASS: function(match, curLoop, inplace, result, not){			match = " " + match[1].replace(/\\/g, "") + " ";			var elem;			for ( var i = 0; (elem = curLoop[i]) != null; i++ ) {				if ( elem ) {					if ( not ^ (" " + elem.className + " ").indexOf(match) >= 0 ) {						if ( !inplace )							result.push( elem );					} else if ( inplace ) {						curLoop[i] = false;					}				}			}			return false;		},		ID: function(match){			return match[1].replace(/\\/g, "");		},		TAG: function(match, curLoop){			for ( var i = 0; curLoop[i] === false; i++ ){}			return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();		},		CHILD: function(match){			if ( match[1] == "nth" ) {				// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'				var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(					match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||					!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);				// calculate the numbers (first)n+(last) including if they are negative				match[2] = (test[1] + (test[2] || 1)) - 0;				match[3] = test[3] - 0;			}			// TODO: Move to normal caching system			match[0] = "done" + (done++);			return match;		},		ATTR: function(match){			var name = match[1].replace(/\\/g, "");						if ( Expr.attrMap[name] ) {				match[1] = Expr.attrMap[name];			}			if ( match[2] === "~=" ) {				match[4] = " " + match[4] + " ";			}			return match;		},		PSEUDO: function(match, curLoop, inplace, result, not){			if ( match[1] === "not" ) {				// If we're dealing with a complex expression, or a simple one				if ( match[3].match(chunker).length > 1 ) {					match[3] = Sizzle(match[3], null, null, curLoop);				} else {					var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);					if ( !inplace ) {						result.push.apply( result, ret );					}					return false;				}			} else if ( Expr.match.POS.test( match[0] ) ) {				return true;			}						return match;		},		POS: function(match){			match.unshift( true );			return match;		}	},	filters: {		enabled: function(elem){			return elem.disabled === false && elem.type !== "hidden";		},		disabled: function(elem){			return elem.disabled === true;		},		checked: function(elem){			return elem.checked === true;		},		selected: function(elem){			// Accessing this property makes selected-by-default			// options in Safari work properly			elem.parentNode.selectedIndex;			return elem.selected === true;		},		parent: function(elem){			return !!elem.firstChild;		},		empty: function(elem){			return !elem.firstChild;		},		has: function(elem, i, match){			return !!Sizzle( match[3], elem ).length;		},		header: function(elem){			return /h\d/i.test( elem.nodeName );		},		text: function(elem){			return "text" === elem.type;		},		radio: function(elem){			return "radio" === elem.type;		},		checkbox: function(elem){			return "checkbox" === elem.type;		},		file: function(elem){			return "file" === elem.type;		},		password: function(elem){			return "password" === elem.type;		},		submit: function(elem){			return "submit" === elem.type;		},		image: function(elem){			return "image" === elem.type;		},		reset: function(elem){			return "reset" === elem.type;		},		button: function(elem){			return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";		},		input: function(elem){			return /input|select|textarea|button/i.test(elem.nodeName);		}	},	setFilters: {		first: function(elem, i){			return i === 0;		},		last: function(elem, i, match, array){			return i === array.length - 1;		},		even: function(elem, i){			return i % 2 === 0;		},		odd: function(elem, i){			return i % 2 === 1;		},		lt: function(elem, i, match){			return i < match[3] - 0;		},		gt: function(elem, i, match){			return i > match[3] - 0;		},		nth: function(elem, i, match){			return match[3] - 0 == i;		},		eq: function(elem, i, match){			return match[3] - 0 == i;		}	},	filter: {		CHILD: function(elem, match){			var type = match[1], parent = elem.parentNode;			var doneName = match[0];						if ( parent && (!parent[ doneName ] || !elem.nodeIndex) ) {				var count = 1;				for ( var node = parent.firstChild; node; node = node.nextSibling ) {					if ( node.nodeType == 1 ) {						node.nodeIndex = count++;					}				}				parent[ doneName ] = count - 1;			}			if ( type == "first" ) {				return elem.nodeIndex == 1;			} else if ( type == "last" ) {				return elem.nodeIndex == parent[ doneName ];			} else if ( type == "only" ) {				return parent[ doneName ] == 1;			} else if ( type == "nth" ) {				var add = false, first = match[2], last = match[3];				if ( first == 1 && last == 0 ) {					return true;				}				if ( first == 0 ) {					if ( elem.nodeIndex == last ) {						add = true;					}				} else if ( (elem.nodeIndex - last) % first == 0 && (elem.nodeIndex - last) / first >= 0 ) {					add = true;				}				return add;			}		},		PSEUDO: function(elem, match, i, array){			var name = match[1], filter = Expr.filters[ name ];			if ( filter ) {				return filter( elem, i, match, array );			} else if ( name === "contains" ) {				return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;			} else if ( name === "not" ) {				var not = match[3];				for ( var i = 0, l = not.length; i < l; i++ ) {					if ( not[i] === elem ) {						return false;					}				}				return true;			}		},		ID: function(elem, match){			return elem.nodeType === 1 && elem.getAttribute("id") === match;		},		TAG: function(elem, match){

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -