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

📄 jquery-1.3.1.js

📁 ajaxpro
💻 JS
📖 第 1 页 / 共 5 页
字号:
			return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;		},		CLASS: function(elem, match){			return match.test( elem.className );		},		ATTR: function(elem, match){			var result = Expr.attrHandle[ match[1] ] ? Expr.attrHandle[ match[1] ]( elem ) : elem[ match[1] ] || elem.getAttribute( match[1] ), value = result + "", type = match[2], check = match[4];			return result == null ?				type === "!=" :				type === "=" ?				value === check :				type === "*=" ?				value.indexOf(check) >= 0 :				type === "~=" ?				(" " + value + " ").indexOf(check) >= 0 :				!match[4] ?				result :				type === "!=" ?				value != check :				type === "^=" ?				value.indexOf(check) === 0 :				type === "$=" ?				value.substr(value.length - check.length) === check :				type === "|=" ?				value === check || value.substr(0, check.length + 1) === check + "-" :				false;		},		POS: function(elem, match, i, array){			var name = match[2], filter = Expr.setFilters[ name ];			if ( filter ) {				return filter( elem, i, match, array );			}		}	}};var origPOS = Expr.match.POS;for ( var type in Expr.match ) {	Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );}var makeArray = function(array, results) {	array = Array.prototype.slice.call( array );	if ( results ) {		results.push.apply( results, array );		return results;	}		return array;};// Perform a simple check to determine if the browser is capable of// converting a NodeList to an array using builtin methods.try {	Array.prototype.slice.call( document.documentElement.childNodes );// Provide a fallback method if it does not work} catch(e){	makeArray = function(array, results) {		var ret = results || [];		if ( toString.call(array) === "[object Array]" ) {			Array.prototype.push.apply( ret, array );		} else {			if ( typeof array.length === "number" ) {				for ( var i = 0, l = array.length; i < l; i++ ) {					ret.push( array[i] );				}			} else {				for ( var i = 0; array[i]; i++ ) {					ret.push( array[i] );				}			}		}		return ret;	};}// Check to see if the browser returns elements by name when// querying by getElementById (and provide a workaround)(function(){	// We're going to inject a fake input element with a specified name	var form = document.createElement("form"),		id = "script" + (new Date).getTime();	form.innerHTML = "<input name='" + id + "'/>";	// Inject it into the root element, check its status, and remove it quickly	var root = document.documentElement;	root.insertBefore( form, root.firstChild );	// The workaround has to do additional checks after a getElementById	// Which slows things down for other browsers (hence the branching)	if ( !!document.getElementById( id ) ) {		Expr.find.ID = function(match, context, isXML){			if ( typeof context.getElementById !== "undefined" && !isXML ) {				var m = context.getElementById(match[1]);				return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];			}		};		Expr.filter.ID = function(elem, match){			var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");			return elem.nodeType === 1 && node && node.nodeValue === match;		};	}	root.removeChild( form );})();(function(){	// Check to see if the browser returns only elements	// when doing getElementsByTagName("*")	// Create a fake element	var div = document.createElement("div");	div.appendChild( document.createComment("") );	// Make sure no comments are found	if ( div.getElementsByTagName("*").length > 0 ) {		Expr.find.TAG = function(match, context){			var results = context.getElementsByTagName(match[1]);			// Filter out possible comments			if ( match[1] === "*" ) {				var tmp = [];				for ( var i = 0; results[i]; i++ ) {					if ( results[i].nodeType === 1 ) {						tmp.push( results[i] );					}				}				results = tmp;			}			return results;		};	}	// Check to see if an attribute returns normalized href attributes	div.innerHTML = "<a href='#'></a>";	if ( div.firstChild && div.firstChild.getAttribute("href") !== "#" ) {		Expr.attrHandle.href = function(elem){			return elem.getAttribute("href", 2);		};	}})();if ( document.querySelectorAll ) (function(){	var oldSizzle = Sizzle, div = document.createElement("div");	div.innerHTML = "<p class='TEST'></p>";	// Safari can't handle uppercase or unicode characters when	// in quirks mode.	if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {		return;	}		Sizzle = function(query, context, extra, seed){		context = context || document;		// Only use querySelectorAll on non-XML documents		// (ID selectors don't work in non-HTML documents)		if ( !seed && context.nodeType === 9 && !isXML(context) ) {			try {				return makeArray( context.querySelectorAll(query), extra );			} catch(e){}		}				return oldSizzle(query, context, extra, seed);	};	Sizzle.find = oldSizzle.find;	Sizzle.filter = oldSizzle.filter;	Sizzle.selectors = oldSizzle.selectors;	Sizzle.matches = oldSizzle.matches;})();if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) {	Expr.order.splice(1, 0, "CLASS");	Expr.find.CLASS = function(match, context) {		return context.getElementsByClassName(match[1]);	};}function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {	for ( var i = 0, l = checkSet.length; i < l; i++ ) {		var elem = checkSet[i];		if ( elem ) {			elem = elem[dir];			var match = false;			while ( elem && elem.nodeType ) {				var done = elem[doneName];				if ( done ) {					match = checkSet[ done ];					break;				}				if ( elem.nodeType === 1 && !isXML )					elem[doneName] = i;				if ( elem.nodeName === cur ) {					match = elem;					break;				}				elem = elem[dir];			}			checkSet[i] = match;		}	}}function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {	for ( var i = 0, l = checkSet.length; i < l; i++ ) {		var elem = checkSet[i];		if ( elem ) {			elem = elem[dir];			var match = false;			while ( elem && elem.nodeType ) {				if ( elem[doneName] ) {					match = checkSet[ elem[doneName] ];					break;				}				if ( elem.nodeType === 1 ) {					if ( !isXML )						elem[doneName] = i;					if ( typeof cur !== "string" ) {						if ( elem === cur ) {							match = true;							break;						}					} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {						match = elem;						break;					}				}				elem = elem[dir];			}			checkSet[i] = match;		}	}}var contains = document.compareDocumentPosition ?  function(a, b){	return a.compareDocumentPosition(b) & 16;} : function(a, b){	return a !== b && (a.contains ? a.contains(b) : true);};var isXML = function(elem){	return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||		!!elem.ownerDocument && isXML( elem.ownerDocument );};var posProcess = function(selector, context){	var tmpSet = [], later = "", match,		root = context.nodeType ? [context] : context;	// Position selectors must be done after the filter	// And so must :not(positional) so we move all PSEUDOs to the end	while ( (match = Expr.match.PSEUDO.exec( selector )) ) {		later += match[0];		selector = selector.replace( Expr.match.PSEUDO, "" );	}	selector = Expr.relative[selector] ? selector + "*" : selector;	for ( var i = 0, l = root.length; i < l; i++ ) {		Sizzle( selector, root[i], tmpSet );	}	return Sizzle.filter( later, tmpSet );};// EXPOSEjQuery.find = Sizzle;jQuery.filter = Sizzle.filter;jQuery.expr = Sizzle.selectors;jQuery.expr[":"] = jQuery.expr.filters;Sizzle.selectors.filters.hidden = function(elem){	return "hidden" === elem.type ||		jQuery.css(elem, "display") === "none" ||		jQuery.css(elem, "visibility") === "hidden";};Sizzle.selectors.filters.visible = function(elem){	return "hidden" !== elem.type &&		jQuery.css(elem, "display") !== "none" &&		jQuery.css(elem, "visibility") !== "hidden";};Sizzle.selectors.filters.animated = function(elem){	return jQuery.grep(jQuery.timers, function(fn){		return elem === fn.elem;	}).length;};jQuery.multiFilter = function( expr, elems, not ) {	if ( not ) {		expr = ":not(" + expr + ")";	}	return Sizzle.matches(expr, elems);};jQuery.dir = function( elem, dir ){	var matched = [], cur = elem[dir];	while ( cur && cur != document ) {		if ( cur.nodeType == 1 )			matched.push( cur );		cur = cur[dir];	}	return matched;};jQuery.nth = function(cur, result, dir, elem){	result = result || 1;	var num = 0;	for ( ; cur; cur = cur[dir] )		if ( cur.nodeType == 1 && ++num == result )			break;	return cur;};jQuery.sibling = function(n, elem){	var r = [];	for ( ; n; n = n.nextSibling ) {		if ( n.nodeType == 1 && n != elem )			r.push( n );	}	return r;};return;window.Sizzle = Sizzle;})();/* * A number of helper functions used for managing events. * Many of the ideas behind this code originated from * Dean Edwards' addEvent library. */jQuery.event = {	// Bind an event to an element	// Original by Dean Edwards	add: function(elem, types, handler, data) {		if ( elem.nodeType == 3 || elem.nodeType == 8 )			return;		// For whatever reason, IE has trouble passing the window object		// around, causing it to be cloned in the process		if ( elem.setInterval && elem != window )			elem = window;		// Make sure that the function being executed has a unique ID		if ( !handler.guid )			handler.guid = this.guid++;		// if data is passed, bind to handler		if ( data !== undefined ) {			// Create temporary function pointer to original handler			var fn = handler;			// Create unique handler function, wrapped around original handler			handler = this.proxy( fn );			// Store data in unique handler			handler.data = data;		}		// Init the element's event structure		var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}),			handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){				// Handle the second event of a trigger and when				// an event is called after a page has unloaded				return typeof jQuery !== "undefined" && !jQuery.event.triggered ?					jQuery.event.handle.apply(arguments.callee.elem, arguments) :					undefined;			});		// Add elem as a property of the handle function		// This is to prevent a memory leak with non-native		// event in IE.		handle.elem = elem;		// Handle multiple events separated by a space		// jQuery(...).bind("mouseover mouseout", fn);		jQuery.each(types.split(/\s+/), function(index, type) {			// Namespaced event handlers			var namespaces = type.split(".");			type = namespaces.shift();			handler.type = namespaces.slice().sort().join(".");			// Get the current list of functions bound to this event			var handlers = events[type];						if ( jQuery.event.specialAll[type] )				jQuery.event.specialAll[type].setup.call(elem, data, namespaces);			// Init the event handler queue			if (!handlers) {				handlers = events[type] = {};				// Check for a special event handler				// Only use addEventListener/attachEvent if the special				// events handler returns false				if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) {					// Bind the global event handler to the element					if (elem.addEventListener)						elem.addEventListener(type, handle, false);					else if (elem.attachEvent)						elem.attachEvent("on" + type, handle);				}			}			// Add the function to the element's handler list			handlers[handler.guid] = handler;			// Keep track of which events have been used, for global triggering			jQuery.event.global[type] = true;		});		// Nullify elem to prevent memory leaks in IE		elem = null;	},	guid: 1,	global: {},	// Detach an event or set of events from an element	remove: function(elem, types, handler) {		// don't do events on text and comment nodes		if ( elem.nodeType == 3 || elem.nodeType == 8 )			return;		var events = jQuery.data(elem, "events"), ret, index;		if ( events ) {			// Unbind all events for the element			if ( types === undefined || (typeof types === "string" && types.charAt(0) == ".") )				for ( var type in events )					this.remove( elem, type + (types || "") );			else {				// types is actually an event object here				if ( types.type ) {					handler = types.handler;					types = types.type;				}				// Handle multiple events seperated by a space				// jQuery(...).unbind("mouseover mouseout", fn);				jQuery.each(types.split(/\s+/), function(index, type){					// Namespaced event handlers					var namespaces = type.split(".");					type = namespaces.shift();					var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");					if ( events[type] ) {						// remove the given handler for the given type						if ( handler )							delete events[type][handler.guid];						// remove all handlers for the given type						else							for ( var handle in events[type] )								// Handle the removal of namespaced events								if ( namespace.test(events[type][handle

⌨️ 快捷键说明

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