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

📄 jquery1.1_api_en.xml

📁 jquery api解压后即可使用
💻 XML
📖 第 1 页 / 共 5 页
字号:
<desc>The name of the property to access.</desc></params><examples><desc>Retrieves the color style of the first paragraph</desc><before>&lt;p style="color:red;"&gt;Test Paragraph.&lt;/p&gt;</before><code>$("p").css("color");</code><result>"red"</result></examples><examples><desc>Retrieves the font-weight style of the first paragraph.</desc><before>&lt;p style="font-weight: bold;"&gt;Test Paragraph.&lt;/p&gt;</before><code>$("p").css("font-weight");</code><result>"bold"</result></examples></method><method cat='CSS' type='jQuery' short='Set a key/value object as style properties to all matched elements.' name='css'><desc>Set a key/value object as style properties to all matched elements.This serves as the best way to set a large number of style propertieson all matched elements.</desc><params type='Map' name='properties'><desc>Key/value pairs to set as style properties.</desc></params><examples><desc>Sets color and background styles to all p elements.</desc><before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before><code>$("p").css({ color: "red", background: "blue" });</code><result>&lt;p style="color:red; background:blue;"&gt;Test Paragraph.&lt;/p&gt;</result></examples></method><method cat='CSS' type='jQuery' short='Set a single style property to a value, on all matched elements.' name='css'><desc>Set a single style property to a value, on all matched elements.If a number is provided, it is automatically converted into a pixel value.</desc><params type='String' name='key'><desc>The name of the property to set.</desc></params><params type='String|Number' name='value'><desc>The value to set the property to.</desc></params><examples><desc>Changes the color of all paragraphs to red</desc><before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before><code>$("p").css("color","red");</code><result>&lt;p style="color:red;"&gt;Test Paragraph.&lt;/p&gt;</result></examples><examples><desc>Changes the left of all paragraphs to "30px"</desc><before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before><code>$("p").css("left",30);</code><result>&lt;p style="left:30px;"&gt;Test Paragraph.&lt;/p&gt;</result></examples></method><method cat='DOM/Attributes' type='String' short='Get the text contents of all matched elements.' name='text'><desc>Get the text contents of all matched elements. The result isa string that contains the combined text contents of all matchedelements. This method works on both HTML and XML documents.</desc><examples><desc>Gets the concatenated text of all paragraphs</desc><before>&lt;p&gt;&lt;b&gt;Test&lt;/b&gt; Paragraph.&lt;/p&gt;&lt;p&gt;Paraparagraph&lt;/p&gt;</before><code>$("p").text();</code><result>Test Paragraph.Paraparagraph</result></examples></method><method cat='DOM/Attributes' type='String' short='Set the text contents of all matched elements.' name='text'><desc>Set the text contents of all matched elements.Similar to html(), but escapes HTML (replace "&lt;" and "&gt;" with theirHTML entities).</desc><params type='String' name='val'><desc>The text value to set the contents of the element to.</desc></params><examples><desc>Sets the text of all paragraphs.</desc><before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before><code>$("p").text("&lt;b&gt;Some&lt;/b&gt; new text.");</code><result>&lt;p&gt;&amp;lt;b&amp;gt;Some&amp;lt;/b&amp;gt; new text.&lt;/p&gt;</result></examples><examples><desc>Sets the text of all paragraphs.</desc><before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before><code>$("p").text("&lt;b&gt;Some&lt;/b&gt; new text.", true);</code><result>&lt;p&gt;Some new text.&lt;/p&gt;</result></examples></method><method cat='DOM/Manipulation' type='jQuery' short='Wrap all matched elements with a structure of other elements.' name='wrap'><desc>Wrap all matched elements with a structure of other elements.This wrapping process is most useful for injecting additionalstucture into a document, without ruining the original semanticqualities of a document.This works by going through the first elementprovided (which is generated, on the fly, from the provided HTML)and finds the deepest ancestor element within itsstructure - it is that element that will en-wrap everything else.This does not work with elements that contain text. Any necessary textmust be added after the wrapping is done.</desc><params type='String' name='html'><desc>A string of HTML, that will be created on the fly and wrapped around the target.</desc></params><examples><code>$("p").wrap("&lt;div class='wrap'&gt;&lt;/div&gt;");</code><result>&lt;div class='wrap'&gt;&lt;p&gt;Test Paragraph.&lt;/p&gt;&lt;/div&gt;</result><before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before></examples></method><method cat='DOM/Manipulation' type='jQuery' short='Wrap all matched elements with a structure of other elements.' name='wrap'><desc>Wrap all matched elements with a structure of other elements.This wrapping process is most useful for injecting additionalstucture into a document, without ruining the original semanticqualities of a document.This works by going through the first elementprovided and finding the deepest ancestor element within itsstructure - it is that element that will en-wrap everything else.This does not work with elements that contain text. Any necessary textmust be added after the wrapping is done.</desc><params type='Element' name='elem'><desc>A DOM element that will be wrapped around the target.</desc></params><examples><code>$("p").wrap( document.getElementById('content') );</code><result>&lt;div id="content"&gt;&lt;p&gt;Test Paragraph.&lt;/p&gt;&lt;/div&gt;</result><before>&lt;p&gt;Test Paragraph.&lt;/p&gt;&lt;div id="content"&gt;&lt;/div&gt;</before></examples></method><method cat='DOM/Manipulation' type='jQuery' short='Append content to the inside of every matched element.' name='append'><desc>Append content to the inside of every matched element.This operation is similar to doing an appendChild to all thespecified elements, adding them into the document.</desc><see>prepend(&lt;Content&gt;)</see><see>before(&lt;Content&gt;)</see><see>after(&lt;Content&gt;)</see><params type='&lt;Content&gt;' name='content'><desc>Content to append to the target</desc></params><examples><desc>Appends some HTML to all paragraphs.</desc><before>&lt;p&gt;I would like to say: &lt;/p&gt;</before><code>$("p").append("&lt;b&gt;Hello&lt;/b&gt;");</code><result>&lt;p&gt;I would like to say: &lt;b&gt;Hello&lt;/b&gt;&lt;/p&gt;</result></examples><examples><desc>Appends an Element to all paragraphs.</desc><before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b id="foo"&gt;Hello&lt;/b&gt;</before><code>$("p").append( $("#foo")[0] );</code><result>&lt;p&gt;I would like to say: &lt;b id="foo"&gt;Hello&lt;/b&gt;&lt;/p&gt;</result></examples><examples><desc>Appends a jQuery object (similar to an Array of DOM Elements) to all paragraphs.</desc><before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b&gt;Hello&lt;/b&gt;</before><code>$("p").append( $("b") );</code><result>&lt;p&gt;I would like to say: &lt;b&gt;Hello&lt;/b&gt;&lt;/p&gt;</result></examples></method><method cat='DOM/Manipulation' type='jQuery' short='Prepend content to the inside of every matched element.' name='prepend'><desc>Prepend content to the inside of every matched element.This operation is the best way to insert elementsinside, at the beginning, of all matched elements.</desc><see>append(&lt;Content&gt;)</see><see>before(&lt;Content&gt;)</see><see>after(&lt;Content&gt;)</see><params type='&lt;Content&gt;' name='content'><desc>Content to prepend to the target.</desc></params><examples><desc>Prepends some HTML to all paragraphs.</desc><before>&lt;p&gt;I would like to say: &lt;/p&gt;</before><code>$("p").prepend("&lt;b&gt;Hello&lt;/b&gt;");</code><result>&lt;p&gt;&lt;b&gt;Hello&lt;/b&gt;I would like to say: &lt;/p&gt;</result></examples><examples><desc>Prepends an Element to all paragraphs.</desc><before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b id="foo"&gt;Hello&lt;/b&gt;</before><code>$("p").prepend( $("#foo")[0] );</code><result>&lt;p&gt;&lt;b id="foo"&gt;Hello&lt;/b&gt;I would like to say: &lt;/p&gt;</result></examples><examples><desc>Prepends a jQuery object (similar to an Array of DOM Elements) to all paragraphs.</desc><before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b&gt;Hello&lt;/b&gt;</before><code>$("p").prepend( $("b") );</code><result>&lt;p&gt;&lt;b&gt;Hello&lt;/b&gt;I would like to say: &lt;/p&gt;</result></examples></method><method cat='DOM/Manipulation' type='jQuery' short='Insert content before each of the matched elements.' name='before'><desc>Insert content before each of the matched elements.</desc><see>append(&lt;Content&gt;)</see><see>prepend(&lt;Content&gt;)</see><see>after(&lt;Content&gt;)</see><params type='&lt;Content&gt;' name='content'><desc>Content to insert before each target.</desc></params><examples><desc>Inserts some HTML before all paragraphs.</desc><before>&lt;p&gt;I would like to say: &lt;/p&gt;</before><code>$("p").before("&lt;b&gt;Hello&lt;/b&gt;");</code><result>&lt;b&gt;Hello&lt;/b&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</result></examples><examples><desc>Inserts an Element before all paragraphs.</desc><before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b id="foo"&gt;Hello&lt;/b&gt;</before><code>$("p").before( $("#foo")[0] );</code><result>&lt;b id="foo"&gt;Hello&lt;/b&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</result></examples><examples><desc>Inserts a jQuery object (similar to an Array of DOM Elements) before all paragraphs.</desc><before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b&gt;Hello&lt;/b&gt;</before><code>$("p").before( $("b") );</code><result>&lt;b&gt;Hello&lt;/b&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</result></examples></method><method cat='DOM/Manipulation' type='jQuery' short='Insert content after each of the matched elements.' name='after'><desc>Insert content after each of the matched elements.</desc><see>append(&lt;Content&gt;)</see><see>prepend(&lt;Content&gt;)</see><see>before(&lt;Content&gt;)</see><params type='&lt;Content&gt;' name='content'><desc>Content to insert after each target.</desc></params><examples><desc>Inserts some HTML after all paragraphs.</desc><before>&lt;p&gt;I would like to say: &lt;/p&gt;</before><code>$("p").after("&lt;b&gt;Hello&lt;/b&gt;");</code><result>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b&gt;Hello&lt;/b&gt;</result></examples><examples><desc>Inserts an Element after all paragraphs.</desc><before>&lt;b id="foo"&gt;Hello&lt;/b&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</before><code>$("p").after( $("#foo")[0] );</code><result>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b id="foo"&gt;Hello&lt;/b&gt;</result></examples><examples><desc>Inserts a jQuery object (similar to an Array of DOM Elements) after all paragraphs.</desc><before>&lt;b&gt;Hello&lt;/b&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</before><code>$("p").after( $("b") );</code><result>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b&gt;Hello&lt;/b&gt;</result></examples></method><method cat='DOM/Traversing' type='jQuery' short='End the most recent &apos;destructive&apos; operation, reverting the list of matched elementsback to its previous state.' name='end'><desc>End the most recent 'destructive' operation, reverting the list of matched elementsback to its previous state. After an end operation, the list of matched elements willrevert to the last state of matched elements.If there was no destructive operation before, an empty set is returned.</desc><examples><desc>Selects all paragraphs, finds span elements inside these, and reverts theselection back to the paragraphs.</desc><before>&lt;p&gt;&lt;span&gt;Hello&lt;/span&gt;, how are you?&lt;/p&gt;</before><code>$("p").find("span").end();</code><result>[ &lt;p&gt;...&lt;/p&gt; ]</result></examples></method><method cat='DOM/Traversing' type='jQuery' short='Searches for all elements that match the specified expression.' name='find'><desc>Searches for all elements that match the specified expression.This method is a good way to find additional descendantelements with which to process.All searching is done using a jQuery expression. The expression can bewritten using CSS 1-3 Selector syntax, or basic XPath.</desc><params type='String' name='expr'><desc>An expression to search with.</desc></params><examples><desc>Starts with all paragraphs and searches for descendant spanelements, same as $("p span")</desc><before>&lt;p&gt;&lt;span&gt;Hello&lt;/span&gt;, how are you?&lt;/p&gt;</before><code>$("p").find("span");</code><result>[ &lt;span&gt;Hello&lt;/span&gt; ]</result></examples></method><method cat='DOM/Manipulation' type='jQuery' short='Clone matched DOM Elements and select the clones.' name='clone'><desc>Clone matched DOM Elements and select the clones. This is useful for moving copies of the elements to anotherlocation in the DOM.</desc><params type='Boolean' name='deep'><desc>(Optional) Set to false if you don't want to clone all descendant nodes, in addition to the element itself.</desc></params><examples><desc>Clones all b elements (and selects the clones) and prepends them to all paragraphs.</desc><before>&lt;b&gt;Hello&lt;/b&gt;&lt;p&gt;, how are you?&lt;/p&gt;</before><code>$("b").clone().prependTo("p");</code><result>&lt;b&gt;Hello&lt;/b&gt;&lt;p&gt;&lt;b&gt;Hello&lt;/b&gt;, how are you?&lt;/p&gt;</result></examples></method>

⌨️ 快捷键说明

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