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

📄 jquery1.1_api_en.xml

📁 jquery api解压后即可使用
💻 XML
📖 第 1 页 / 共 5 页
字号:
<?xml version='1.0' encoding='ISO-8859-1'?><?xml-stylesheet type='text/xsl' href='style/docs.xsl'?><docs version='1.1'><method cat='Core' type='jQuery' short='This function accepts a string containing a CSS orbasic XPath selector which is then used to match a set of elements.' name='$'><desc>This function accepts a string containing a CSS orbasic XPath selector which is then used to match a set of elements.The core functionality of jQuery centers around this function.Everything in jQuery is based upon this, or uses this in some way.The most basic use of this function is to pass in an expression(usually consisting of CSS or XPath), which then finds all matchingelements.By default, $() looks for DOM elements within the context of thecurrent HTML document.</desc><see>$(Element)</see><see>$(Element&lt;Array&gt;)</see><params type='String' name='expr'><desc>An expression to search with</desc></params><params type='Element|jQuery' name='context'><desc>(optional) A DOM Element, Document or jQuery to use as context</desc></params><examples><desc>Finds all p elements that are children of a div element.</desc><before>&lt;p&gt;one&lt;/p&gt; &lt;div&gt;&lt;p&gt;two&lt;/p&gt;&lt;/div&gt; &lt;p&gt;three&lt;/p&gt;</before><code>$("div &gt; p")</code><result>[ &lt;p&gt;two&lt;/p&gt; ]</result></examples><examples><desc>Searches for all inputs of type radio within the first form in the document</desc><code>$("input:radio", document.forms[0])</code></examples><examples><desc>This finds all div elements within the specified XML document.</desc><code>$("div", xml.responseXML)</code></examples></method><method cat='Core' type='jQuery' see='appendTo(String)' short='Create DOM elements on-the-fly from the provided String of raw HTML.' name='$'><desc>Create DOM elements on-the-fly from the provided String of raw HTML.</desc><params type='String' name='html'><desc>A string of HTML to create on the fly.</desc></params><examples><desc>Creates a div element (and all of its contents) dynamically, and appends it to the element with the ID of body. Internally, anelement is created and it's innerHTML property set to the given markup.It is therefore both quite flexible and limited.</desc><code>$("&lt;div&gt;&lt;p&gt;Hello&lt;/p&gt;&lt;/div&gt;").appendTo("#body")</code></examples></method><method cat='Core' type='jQuery' short='Wrap jQuery functionality around a single or multiple DOM Element(s).' name='$'><desc>Wrap jQuery functionality around a single or multiple DOM Element(s).This function also accepts XML Documents and Window objectsas valid arguments (even though they are not DOM Elements).</desc><params type='Element|Array&lt;Element&gt;' name='elems'><desc>DOM element(s) to be encapsulated by a jQuery object.</desc></params><examples><desc>Sets the background color of the page to black.</desc><code>$(document.body).background( "black" );</code></examples><examples><desc>Hides all the input elements within a form</desc><code>$( myForm.elements ).hide()</code></examples></method><method cat='Core' type='jQuery' see='ready(Function)' short='A shorthand for $(document).' name='$'><desc>A shorthand for $(document).ready(), allowing you to bind a functionto be executed when the DOM document has finished loading. This functionbehaves just like $(document).ready(), in that it should be used to wrapall of the other $() operations on your page. While this function is,technically, chainable - there really isn't much use for chaining against it.You can have as many $(document).ready events on your page as you like.See ready(Function) for details about the ready event.</desc><params type='Function' name='fn'><desc>The function to execute when the DOM is ready.</desc></params><examples><desc>Executes the function when the DOM is ready to be used.</desc><code>$(function(){  // Document is ready});</code></examples><examples><desc>Uses both the shortcut for $(document).ready() and the argumentto write failsafe jQuery code using the $ alias, without relying on theglobal alias.</desc><code>jQuery(function($) {  // Your code using failsafe $ alias here...});</code></examples></method><method property='1' cat='Core' type='String' short='The current version of jQuery.' name='jquery' private='1'><desc>The current version of jQuery.</desc></method><method property='1' cat='Core' type='Number' short='The number of elements currently matched.' name='length'><desc>The number of elements currently matched.</desc><examples><code>$("img").length;</code><result>2</result><before>&lt;img src="test1.jpg"/&gt; &lt;img src="test2.jpg"/&gt;</before></examples></method><method cat='Core' type='Number' short='The number of elements currently matched.' name='size'><desc>The number of elements currently matched.</desc><examples><code>$("img").size();</code><result>2</result><before>&lt;img src="test1.jpg"/&gt; &lt;img src="test2.jpg"/&gt;</before></examples></method><method cat='Core' type='Array&lt;Element&gt;' short='Access all matched elements.' name='get'><desc>Access all matched elements. This serves as a backwards-compatibleway of accessing all matched elements (other than the jQuery objectitself, which is, in fact, an array of elements).</desc><examples><desc>Selects all images in the document and returns the DOM Elements as an Array</desc><before>&lt;img src="test1.jpg"/&gt; &lt;img src="test2.jpg"/&gt;</before><code>$("img").get();</code><result>[ &lt;img src="test1.jpg"/&gt; &lt;img src="test2.jpg"/&gt; ]</result></examples></method><method cat='Core' type='Element' short='Access a single matched element.' name='get'><desc>Access a single matched element. num is used to access theNth element matched.</desc><params type='Number' name='num'><desc>Access the element in the Nth position.</desc></params><examples><desc>Selects all images in the document and returns the first one</desc><before>&lt;img src="test1.jpg"/&gt; &lt;img src="test2.jpg"/&gt;</before><code>$("img").get(0);</code><result>[ &lt;img src="test1.jpg"/&gt; ]</result></examples></method><method cat='Core' type='jQuery' short='Set the jQuery object to an array of elements, while maintainingthe stack.' name='pushStack' private='1'><desc>Set the jQuery object to an array of elements, while maintainingthe stack.</desc><params type='Elements' name='elems'><desc>An array of elements</desc></params><examples><code>$("img").pushStack([ document.body ]);</code><result>$("img").pushStack() == [ document.body ]</result></examples></method><method cat='Core' type='jQuery' short='Set the jQuery object to an array of elements.' name='setArray' private='1'><desc>Set the jQuery object to an array of elements. This operation iscompletely destructive - be sure to use .pushStack() if you wish to maintainthe jQuery stack.</desc><params type='Elements' name='elems'><desc>An array of elements</desc></params><examples><code>$("img").setArray([ document.body ]);</code><result>$("img").setArray() == [ document.body ]</result></examples></method><method cat='Core' type='jQuery' short='Execute a function within the context of every matched element.' name='each'><desc>Execute a function within the context of every matched element.This means that every time the passed-in function is executed(which is once for every element matched) the 'this' keywordpoints to the specific element.Additionally, the function, when executed, is passed a singleargument representing the position of the element in the matchedset.</desc><params type='Function' name='fn'><desc>A function to execute</desc></params><examples><desc>Iterates over two images and sets their src property</desc><before>&lt;img/&gt;&lt;img/&gt;</before><code>$("img").each(function(i){  this.src = "test" + i + ".jpg";});</code><result>&lt;img src="test0.jpg"/&gt;&lt;img src="test1.jpg"/&gt;</result></examples></method><method cat='Core' type='Number' short='Searches every matched element for the object and returnsthe index of the element, if found, starting with zero.' name='index'><desc>Searches every matched element for the object and returnsthe index of the element, if found, starting with zero. Returns -1 if the object wasn't found.</desc><params type='Element' name='subject'><desc>Object to search for</desc></params><examples><desc>Returns the index for the element with ID foobar</desc><before>&lt;div id="foobar"&gt;&lt;b&gt;&lt;/b&gt;&lt;span id="foo"&gt;&lt;/span&gt;&lt;/div&gt;</before><code>$("*").index( $('#foobar')[0] )</code><result>0</result></examples><examples><desc>Returns the index for the element with ID foo within another element</desc><before>&lt;div id="foobar"&gt;&lt;b&gt;&lt;/b&gt;&lt;span id="foo"&gt;&lt;/span&gt;&lt;/div&gt;</before><code>$("*").index( $('#foo')[0] )</code><result>2</result></examples><examples><desc>Returns -1, as there is no element with ID bar</desc><before>&lt;div id="foobar"&gt;&lt;b&gt;&lt;/b&gt;&lt;span id="foo"&gt;&lt;/span&gt;&lt;/div&gt;</before><code>$("*").index( $('#bar')[0] )</code><result>-1</result></examples></method><method cat='DOM/Attributes' type='Object' short='Access a property on the first matched element.' name='attr'><desc>Access a property on the first matched element.This method makes it easy to retrieve a property valuefrom the first matched element.</desc><params type='String' name='name'><desc>The name of the property to access.</desc></params><examples><desc>Returns the src attribute from the first image in the document.</desc><before>&lt;img src="test.jpg"/&gt;</before><code>$("img").attr("src");</code><result>test.jpg</result></examples></method><method cat='DOM/Attributes' type='jQuery' short='Set a key/value object as properties to all matched elements.' name='attr'><desc>Set a key/value object as properties to all matched elements.This serves as the best way to set a large number of propertieson all matched elements.</desc><params type='Map' name='properties'><desc>Key/value pairs to set as object properties.</desc></params><examples><desc>Sets src and alt attributes to all images.</desc><before>&lt;img/&gt;</before><code>$("img").attr({ src: "test.jpg", alt: "Test Image" });</code><result>&lt;img src="test.jpg" alt="Test Image"/&gt;</result></examples></method><method cat='DOM/Attributes' type='jQuery' short='Set a single property to a value, on all matched elements.' name='attr'><desc>Set a single property to a value, on all matched elements.Can compute values provided as ${formula}, see second example.Note that you can't set the name property of input elements in IE.Use $(html) or .append(html) or .html(html) to create elementson the fly including the name property.</desc><params type='String' name='key'><desc>The name of the property to set.</desc></params><params type='Object' name='value'><desc>The value to set the property to.</desc></params><examples><desc>Sets src attribute to all images.</desc><before>&lt;img/&gt;</before><code>$("img").attr("src","test.jpg");</code><result>&lt;img src="test.jpg"/&gt;</result></examples><examples><desc>Sets title attribute from src attribute, a shortcut for attr(String,Function)</desc><before>&lt;img src="test.jpg" /&gt;</before><code>$("img").attr("title", "${this.src}");</code><result>&lt;img src="test.jpg" title="test.jpg" /&gt;</result></examples></method><method cat='DOM/Attributes' type='jQuery' short='Set a single property to a computed value, on all matched elements.' name='attr'><desc>Set a single property to a computed value, on all matched elements.Instead of a value, a function is provided, that computes the value.</desc><params type='String' name='key'><desc>The name of the property to set.</desc></params><params type='Function' name='value'><desc>A function returning the value to set.</desc></params><examples><desc>Sets title attribute from src attribute.</desc><before>&lt;img src="test.jpg" /&gt;</before><code>$("img").attr("title", function() { return this.src });</code><result>&lt;img src="test.jpg" title="test.jpg" /&gt;</result></examples></method><method cat='CSS' type='String' short='Access a style property on the first matched element.' name='css'><desc>Access a style property on the first matched element.This method makes it easy to retrieve a style property valuefrom the first matched element.</desc><params type='String' name='name'>

⌨️ 快捷键说明

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