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

📄 jquery1.1_api_en.xml

📁 jquery api解压后即可使用
💻 XML
📖 第 1 页 / 共 5 页
字号:
<method cat='DOM/Traversing' type='jQuery' short='Removes all elements from the set of matched elements that do notmatch the specified expression(s).' name='filter'><desc>Removes all elements from the set of matched elements that do notmatch the specified expression(s). This method is used to narrow downthe results of a search.Provide a comma-separated list of expressions to apply multiple filters at once.</desc><params type='String' name='expression'><desc>Expression(s) to search with.</desc></params><examples><desc>Selects all paragraphs and removes those without a class "selected".</desc><before>&lt;p class="selected"&gt;Hello&lt;/p&gt;&lt;p&gt;How are you?&lt;/p&gt;</before><code>$("p").filter(".selected")</code><result>[ &lt;p class="selected"&gt;Hello&lt;/p&gt; ]</result></examples><examples><desc>Selects all paragraphs and removes those without class "selected" and being the first one.</desc><before>&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;Hello Again&lt;/p&gt;&lt;p class="selected"&gt;And Again&lt;/p&gt;</before><code>$("p").filter(".selected, :first")</code><result>[ &lt;p&gt;Hello&lt;/p&gt;, &lt;p class="selected"&gt;And Again&lt;/p&gt; ]</result></examples></method><method cat='DOM/Traversing' type='jQuery' short='Removes all elements from the set of matched elements that do notpass the specified filter.' name='filter'><desc>Removes all elements from the set of matched elements that do notpass the specified filter. This method is used to narrow downthe results of a search.</desc><params type='Function' name='filter'><desc>A function to use for filtering</desc></params><examples><desc>Remove all elements that have a child ol element</desc><before>&lt;p&gt;&lt;ol&gt;&lt;li&gt;Hello&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;&lt;p&gt;How are you?&lt;/p&gt;</before><code>$("p").filter(function(index) {  return $("ol", this).length == 0;})</code><result>[ &lt;p&gt;How are you?&lt;/p&gt; ]</result></examples></method><method cat='DOM/Traversing' type='jQuery' short='Removes the specified Element from the set of matched elements.' name='not'><desc>Removes the specified Element from the set of matched elements. Thismethod is used to remove a single Element from a jQuery object.</desc><params type='Element' name='el'><desc>An element to remove from the set</desc></params><examples><desc>Removes the element with the ID "selected" from the set of all paragraphs.</desc><before>&lt;p&gt;Hello&lt;/p&gt;&lt;p id="selected"&gt;Hello Again&lt;/p&gt;</before><code>$("p").not( $("#selected")[0] )</code><result>[ &lt;p&gt;Hello&lt;/p&gt; ]</result></examples></method><method cat='DOM/Traversing' type='jQuery' short='Removes elements matching the specified expression from the setof matched elements.' name='not'><desc>Removes elements matching the specified expression from the setof matched elements. This method is used to remove one or moreelements from a jQuery object.</desc><params type='String' name='expr'><desc>An expression with which to remove matching elements</desc></params><examples><desc>Removes the element with the ID "selected" from the set of all paragraphs.</desc><before>&lt;p&gt;Hello&lt;/p&gt;&lt;p id="selected"&gt;Hello Again&lt;/p&gt;</before><code>$("p").not("#selected")</code><result>[ &lt;p&gt;Hello&lt;/p&gt; ]</result></examples></method><method cat='DOM/Traversing' type='jQuery' short='Removes any elements inside the array of elements from the setof matched elements.' name='not'><desc>Removes any elements inside the array of elements from the setof matched elements. This method is used to remove one or moreelements from a jQuery object.</desc><params type='jQuery' name='elems'><desc>A set of elements to remove from the jQuery set of matched elements.</desc></params><examples><desc>Removes all elements that match "div p.selected" from the total set of all paragraphs.</desc><before>&lt;div&gt;&lt;p&gt;Hello&lt;/p&gt;&lt;p class="selected"&gt;Hello Again&lt;/p&gt;&lt;/div&gt;</before><code>$("p").not( $("div p.selected") )</code><result>[ &lt;p&gt;Hello&lt;/p&gt; ]</result></examples></method><method cat='DOM/Traversing' type='jQuery' short='Adds more elements, matched by the given expression,to the set of matched elements.' name='add'><desc>Adds more elements, matched by the given expression,to the set of matched elements.</desc><params type='String' name='expr'><desc>An expression whose matched elements are added</desc></params><examples><code>$("p").add("span")</code><result>[ &lt;p&gt;Hello&lt;/p&gt;, &lt;span&gt;Hello Again&lt;/span&gt; ]</result><before>&lt;p&gt;Hello&lt;/p&gt;&lt;span&gt;Hello Again&lt;/span&gt;</before></examples></method><method cat='DOM/Traversing' type='jQuery' short='Adds more elements, created on the fly, to the set ofmatched elements.' name='add'><desc>Adds more elements, created on the fly, to the set ofmatched elements.</desc><params type='String' name='html'><desc>A string of HTML to create on the fly.</desc></params><examples><code>$("p").add("&lt;span&gt;Again&lt;/span&gt;")</code><result>[ &lt;p&gt;Hello&lt;/p&gt;, &lt;span&gt;Again&lt;/span&gt; ]</result><before>&lt;p&gt;Hello&lt;/p&gt;</before></examples></method><method cat='DOM/Traversing' type='jQuery' short='Adds one or more Elements to the set of matched elements.' name='add'><desc>Adds one or more Elements to the set of matched elements.</desc><params type='Element|Array&lt;Element&gt;' name='elements'><desc>One or more Elements to add</desc></params><examples><code>$("p").add( document.getElementById("a") )</code><result>[ &lt;p&gt;Hello&lt;/p&gt;, &lt;span id="a"&gt;Hello Again&lt;/span&gt; ]</result><before>&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;&lt;span id="a"&gt;Hello Again&lt;/span&gt;&lt;/p&gt;</before></examples><examples><code>$("p").add( document.forms[0].elements )</code><result>[ &lt;p&gt;Hello&lt;/p&gt;, &lt;input/&gt;, &lt;button/&gt; ]</result><before>&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;&lt;form&gt;&lt;input/&gt;&lt;button/&gt;&lt;/form&gt;</before></examples></method><method cat='DOM/Traversing' type='Boolean' short='Checks the current selection against an expression and returns true,if at least one element of the selection fits the given expression.' name='is'><desc>Checks the current selection against an expression and returns true,if at least one element of the selection fits the given expression.Does return false, if no element fits or the expression is not valid.filter(String) is used internally, therefore all rules that apply thereapply here, too.</desc><params type='String' name='expr'><desc>The expression with which to filter</desc></params><examples><desc>Returns true, because the parent of the input is a form element</desc><before>&lt;form&gt;&lt;input type="checkbox" /&gt;&lt;/form&gt;</before><code>$("input[@type='checkbox']").parent().is("form")</code><result>true</result></examples><examples><desc>Returns false, because the parent of the input is a p element</desc><before>&lt;form&gt;&lt;p&gt;&lt;input type="checkbox" /&gt;&lt;/p&gt;&lt;/form&gt;</before><code>$("input[@type='checkbox']").parent().is("form")</code><result>false</result></examples></method><method cat='DOM/Attributes' type='String' short='Get the current value of the first matched element.' name='val'><desc>Get the current value of the first matched element.</desc><examples><code>$("input").val();</code><result>"some text"</result><before>&lt;input type="text" value="some text"/&gt;</before></examples></method><method cat='DOM/Attributes' type='jQuery' short='Set the value of every matched element.' name='val'><desc>Set the value of every matched element.</desc><params type='String' name='val'><desc>Set the property to the specified value.</desc></params><examples><code>$("input").val("test");</code><result>&lt;input type="text" value="test"/&gt;</result><before>&lt;input type="text" value="some text"/&gt;</before></examples></method><method cat='DOM/Attributes' type='String' short='Get the html contents of the first matched element.' name='html'><desc>Get the html contents of the first matched element.This property is not available on XML documents.</desc><examples><code>$("div").html();</code><result>&lt;input/&gt;</result><before>&lt;div&gt;&lt;input/&gt;&lt;/div&gt;</before></examples></method><method cat='DOM/Attributes' type='jQuery' short='Set the html contents of every matched element.' name='html'><desc>Set the html contents of every matched element.This property is not available on XML documents.</desc><params type='String' name='val'><desc>Set the html contents to the specified value.</desc></params><examples><code>$("div").html("&lt;b&gt;new stuff&lt;/b&gt;");</code><result>&lt;div&gt;&lt;b&gt;new stuff&lt;/b&gt;&lt;/div&gt;</result><before>&lt;div&gt;&lt;input/&gt;&lt;/div&gt;</before></examples></method><method cat='Core' type='jQuery' short='' name='domManip' private='1'><desc></desc><params type='Array' name='args'><desc></desc></params><params type='Boolean' name='table'><desc>Insert TBODY in TABLEs if one is not found.</desc></params><params type='Number' name='dir'><desc>If dir&lt;0, process args in reverse order.</desc></params><params type='Function' name='fn'><desc>The function doing the DOM manipulation.</desc></params></method><method cat='Core' type='Object' short='Extends the jQuery object itself.' name='$.extend'><desc>Extends the jQuery object itself. Can be used to add functions intothe jQuery namespace and to add plugin methods (plugins).</desc><params type='Object' name='prop'><desc>The object that will be merged into the jQuery object</desc></params><examples><desc>Adds two plugin methods.</desc><code>jQuery.fn.extend({  check: function() {    return this.each(function() { this.checked = true; });  },  uncheck: function() {    return this.each(function() { this.checked = false; });  }});$("input[@type=checkbox]").check();$("input[@type=radio]").uncheck();</code></examples><examples><desc>Adds two functions into the jQuery namespace</desc><code>jQuery.extend({  min: function(a, b) { return a &lt; b ? a : b; },  max: function(a, b) { return a &gt; b ? a : b; }});</code></examples></method><method cat='JavaScript' type='Object' short='Extend one object with one or more others, returning the original,modified, object.' name='$.extend'><desc>Extend one object with one or more others, returning the original,modified, object. This is a great utility for simple inheritance.</desc><params type='Object' name='target'><desc>The object to extend</desc></params><params type='Object' name='prop1'><desc>The object that will be merged into the first.</desc></params><params type='Object' name='propN'><desc>(optional) More objects to merge into the first</desc></params><examples><desc>Merge settings and options, modifying settings</desc><code>var settings = { validate: false, limit: 5, name: "foo" };var options = { validate: true, name: "bar" };jQuery.extend(settings, options);</code><result>settings == { validate: true, limit: 5, name: "bar" }</result></examples><examples><desc>Merge defaults and options, without modifying the defaults</desc><code>var defaults = { validate: false, limit: 5, name: "foo" };var options = { validate: true, name: "bar" };var settings = jQuery.extend({}, defaults, options);</code><result>settings == { validate: true, limit: 5, name: "bar" }</result></examples></method><method cat='Core' type='undefined' short='Run this function to give control of the $ variable backto whichever library first implemented it.' name='$.noConflict'><desc>Run this function to give control of the $ variable backto whichever library first implemented it. This helps to make sure that jQuery doesn't conflict with the $ objectof other libraries.By using this function, you will only be able to access jQueryusing the 'jQuery' variable. For example, where you used to do$("div p"), you now must do jQuery("div p").</desc><examples><desc>Maps the original object that was referenced by $ back to $</desc><code>jQuery.noConflict();// Do something with jQueryjQuery("div p").hide();// Do something with another library's $()$("content").style.display = 'none';</code></examples><examples><desc>Reverts the $ alias and then creates and executes afunction to provide the $ as a jQuery alias inside the functionsscope. Inside the function the original $ object is not available.This works well for most plugins that don't rely on any other library.</desc><code>jQuery.noConflict();(function($) {   $(function() {    // more code using $ as alias to jQuery  });})(jQuery);

⌨️ 快捷键说明

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