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

📄 jquery.1.2.3.intellisense.js

📁 一个工作流OA
💻 JS
📖 第 1 页 / 共 5 页
字号:
			if ( elem[0] == undefined || jQuery.nodeName( elem, "form" ) || elem.options )				ret.push( elem );			else				ret = jQuery.merge( ret, elem );		});		return ret;	},		attr: function( elem, name, value ) {		// don't set attributes on text and comment nodes		if (!elem || elem.nodeType == 3 || elem.nodeType == 8)			return undefined;		var fix = jQuery.isXMLDoc( elem ) ?			{} :			jQuery.props;		// Safari mis-reports the default selected property of a hidden option		// Accessing the parent's selectedIndex property fixes it		if ( name == "selected" && jQuery.browser.safari )			elem.parentNode.selectedIndex;				// Certain attributes only work when accessed via the old DOM 0 way		if ( fix[ name ] ) {			if ( value != undefined )				elem[ fix[ name ] ] = value;			return elem[ fix[ name ] ];		} else if ( jQuery.browser.msie && name == "style" )			return jQuery.attr( elem.style, "cssText", value );		else if ( value == undefined && jQuery.browser.msie && jQuery.nodeName( elem, "form" ) && (name == "action" || name == "method") )			return elem.getAttributeNode( name ).nodeValue;		// IE elem.getAttribute passes even for style		else if ( elem.tagName ) {			if ( value != undefined ) {				// We can't allow the type property to be changed (since it causes problems in IE)				if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )					throw "type property can't be changed";				// convert the value to a string (all browsers do this but IE) see #1070				elem.setAttribute( name, "" + value );			}			if ( jQuery.browser.msie && /href|src/.test( name ) && !jQuery.isXMLDoc( elem ) ) 				return elem.getAttribute( name, 2 );			return elem.getAttribute( name );		// elem is actually elem.style ... set the style		} else {			// IE actually uses filters for opacity			if ( name == "opacity" && jQuery.browser.msie ) {				if ( value != undefined ) {					// IE has trouble with opacity if it does not have layout					// Force it by setting the zoom level					elem.zoom = 1; 						// Set the alpha filter to set the opacity					elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) +						(parseFloat( value ).toString() == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");				}					return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?					(parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100).toString() :					"";			}			name = name.replace(/-([a-z])/ig, function(all, letter){				return letter.toUpperCase();			});			if ( value != undefined )				elem[ name ] = value;			return elem[ name ];		}	},		trim: function( text ) {		///<summary>Remove the whitespace from the beginning and end of a string.</summary>		///<param name="text">The string to trim.</param>		///<returns type="String" />				return (text || "").replace( /^\s+|\s+$/g, "" );	},	makeArray: function( array ) {		///<summary>Turns an array-like object into a true array.</summary>		///<param name="array">Array-like object to turn in to an actual Array.</param>		///<returns type="Array" />				var ret = [];		// Need to use typeof to fight Safari childNodes crashes		if ( typeof array != "array" )			for ( var i = 0, length = array.length; i < length; i++ )				ret.push( array[ i ] );		else			ret = array.slice( 0 );		return ret;	},	inArray: function( elem, array ) {		///<summary>Determine the index of the first parameter in the Array (-1 if not found).</summary>		///<param name="elem">Value to see if it exists in the array.</param>		///<param name="array">Array to look through for the value.</param>		///<returns type="Number" />				for ( var i = 0, length = array.length; i < length; i++ )			if ( array[ i ] == elem )				return i;		return -1;	},	merge: function( first, second ) {		// We have to loop this way because IE & Opera overwrite the length		// expando of getElementsByTagName		// Also, we need to make sure that the correct elements are being returned		// (IE returns comment nodes in a '*' query)		if ( jQuery.browser.msie ) {			for ( var i = 0; second[ i ]; i++ )				if ( second[ i ].nodeType != 8 )					first.push( second[ i ] );		} else			for ( var i = 0; second[ i ]; i++ )				first.push( second[ i ] );		return first;	},	unique: function( array ) {		///<summary>Remove all duplicate elements from an array of elements.</summary>		///<param name="array">The Array to translate.</param>		///<returns type="Array" />				var ret = [], done = {};		try {			for ( var i = 0, length = array.length; i < length; i++ ) {				var id = jQuery.data( array[ i ] );				if ( !done[ id ] ) {					done[ id ] = true;					ret.push( array[ i ] );				}			}		} catch( e ) {			ret = array;		}		return ret;	},	grep: function( elems, callback, inv ) {		///<summary>Filter items out of an array, by using a filter function.</summary>		///<param name="array">The Array to find items in.</param>		///<param name="callback">The function to process each item against. The first argument to the function is the list item, and the second argument is the list index. The function should return a Boolean value. Optionally, this argument may be a string rather than a function. If the argument is a string, it is treated as a short "lambda-form" function, with "a" representing the list item and "i" representing the index. For example, "a > 0" may be passed instead of "function(a){ return a > 0; }".</param>		///<param name="inv" optional="true">(optional) If "inv" (invert) is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false.</param>		///<returns type="Array" />				var ret = [];		// Go through the array, only saving the items		// that pass the validator function		for ( var i = 0, length = elems.length; i < length; i++ )			if ( !inv && callback( elems[ i ], i ) || inv && !callback( elems[ i ], i ) )				ret.push( elems[ i ] );		return ret;	},	map: function( elems, callback ) {		var ret = [];		// Go through the array, translating each of the items to their		// new value (or values).		for ( var i = 0, length = elems.length; i < length; i++ ) {			var value = callback( elems[ i ], i );			if ( value !== null && value != undefined ) {				if ( value.constructor != Array )					value = [ value ];				ret = ret.concat( value );			}		}		return ret;	}});var userAgent = navigator.userAgent.toLowerCase();// Figure out what browser is being usedjQuery.browser = {		///<summary>Contains flags for the useragent, read from navigator.userAgent.</summary>			version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1],	safari: /webkit/.test( userAgent ),	opera: /opera/.test( userAgent ),	msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),	mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )};var styleFloat = jQuery.browser.msie ?	"styleFloat" :	"cssFloat";	jQuery.extend({	// Check to see if the W3C box model is being used	boxModel: !jQuery.browser.msie || document.compatMode == "CSS1Compat",		props: {		"for": "htmlFor",		"class": "className",		"float": styleFloat,		cssFloat: styleFloat,		styleFloat: styleFloat,		innerHTML: "innerHTML",		className: "className",		value: "value",		disabled: "disabled",		checked: "checked",		readonly: "readOnly",		selected: "selected",		maxlength: "maxLength",		selectedIndex: "selectedIndex",		defaultValue: "defaultValue",		tagName: "tagName",		nodeName: "nodeName"	}});jQuery.each({	parent: function(elem){return elem.parentNode;},	parents: function(elem){return jQuery.dir(elem,"parentNode");},	next: function(elem){return jQuery.nth(elem,2,"nextSibling");},	prev: function(elem){return jQuery.nth(elem,2,"previousSibling");},	nextAll: function(elem){return jQuery.dir(elem,"nextSibling");},	prevAll: function(elem){return jQuery.dir(elem,"previousSibling");},	siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},	children: function(elem){return jQuery.sibling(elem.firstChild);},	contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}}, function(name, fn){	jQuery.fn[ name ] = function( selector ) {		///<summary>Finds a set of elements.</summary>		///<param name="selector" optional="true">(optional) An expression to filter the elements with.</param>		///<returns type="jQuery" />		var ret = jQuery.map( this, fn );		if ( selector && typeof selector == "string" )			ret = jQuery.multiFilter( selector, ret );		return this.pushStack( jQuery.unique( ret ) );	};});jQuery.each({	appendTo: "append",	prependTo: "prepend",	insertBefore: "before",	insertAfter: "after",	replaceAll: "replaceWith"}, function(name, original){		///<summary>		///Add all of the matched elements to another, specified, set of elements. e.g. $("span").appendTo("#foo");		///Note: intellisense not working.		///</summary>		///<param name="name">target to which the content will be appended.</param>		///<returns type="jQuery" />			jQuery.fn[ name ] = function() {		var args = arguments;		return this.each(function(){			for ( var i = 0, length = args.length; i < length; i++ )				jQuery( args[ i ] )[ original ]( this );		});	};});jQuery.each({	removeAttr: function( name ) {		///<summary>Remove an attribute from each of the matched elements.  Note: intellisense not working</summary>		///<param name="name">The name of the property to remove.</param>		///<returns type="jQuery" />		jQuery.attr( this, name, "" );		if (this.nodeType == 1) 			this.removeAttribute( name );	},	addClass: function( classNames ) {		///<summary>Adds the specified class(es) to each of the set of matched elements.</summary>		///<param name="className">One or more CSS classes to add to the elements, these are separated by spaces.</param>		///<returns type="jQuery" />				jQuery.className.add( this, classNames );	},	removeClass: function( classNames ) {		///<summary>Removes all or the specified class(es) from the set of matched elements.</summary>		///<param name="className">One or more CSS classes to remove from the elements, these are separated by spaces.</param>		///<returns type="jQuery" />				jQuery.className.remove( this, classNames );	},	toggleClass: function( classNames ) {		///<summary>Adds the specified class if it is not present, removes the specified class if it is present.</summary>		///<param name="className">A CSS class to toggle on the elements.</param>		///<returns type="jQuery" />				jQuery.className[ jQuery.className.has( this, classNames ) ? "remove" : "add" ]( this, classNames );	},	remove: function( selector ) {		///<summary>Removes all matched elements from the DOM. Note: Intellisense not working.</summary>		///<param name="selector" optional="true">(optional) A jQuery expression to filter the set of elements to be removed.</param>		///<returns type="jQuery" />				if ( !selector || jQuery.filter( selector, [ this ] ).r.length ) {			// Prevent memory leaks			jQuery( "*", this ).add(this).each(function(){				jQuery.event.remove(this);				jQuery.removeData(this);			});			if (this.parentNode)				this.parentNode.removeChild( this );		}	},	empty: function() {		///<summary>Remove all child nodes from the set of matched elements. Note: Intellisense not working.</summary>		///<returns type="jQuery" />				// Remove element nodes and prevent memory leaks		jQuery( ">*", this ).remove();				// Remove any remaining nodes		while ( this.firstChild )			this.removeChild( this.firstChild );	}}, function(name, fn){	jQuery.fn[ name ] = function(){		return this.each( fn, arguments );	};});jQuery.each([ "Height", "Width" ], function(i, name){	var type = name.toLowerCase();		jQuery.fn[ type ] = function( size ) {	    ///<summary>Returns the Height or Width	    ///  1. Height() - Get the current computed, pixel, height of the first matched element.	    ///  2. Height(val) - Set the CSS height of every matched element.	    ///  1. Width() - Get the current computed, pixel, width of the first matched element.	    ///  2. Width(val) - Set the CSS width of every matched element.	    ///</summary>		///<param name="size" optional="true">(optional) Set the CSS property to the specified value.</param>	    ///<returns type="jQuery" />		// Get window width or height		return this[0] == window ?			// Opera reports document.body.client[Width/Height] properly in both quirks and standards			jQuery.browser.opera && document.body[ "client" + name ] || 						// Safari reports inner[Width/Height] just fine (Mozilla and Opera include scroll bar widths)			jQuery.browser.safari && window[ "inner" + name ] ||						// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode			document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] || document.body[ "client" + name ] :					// Get document width or height			this[0] == document ?				// Either scroll[Width/Height] or offset[Width/Height], whichever is greater				Math.max( 					Math.max(document.body["scroll" + name], document.documentElement["scroll" + name]), 					Math.max(document.body["offset" + name], document.documentElement["offset" + name]) 				) :				// Get or set width or height on the element				size == undefined ?					// Get width or height on the element					(this.length ? jQuery.css( this[0], type ) : null) :					// Set the width or height on the element (default to pixels if value is unitless)					this.css( type, size.constructor == String ? size : size + "px" );	};});var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ?		"(?:[\\w*_-]|\\\\.)" :

⌨️ 快捷键说明

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