Skip to content

Entries: Document $.fn.labels #271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions entries/labels.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<entry name="labels" type="method" return="jQuery">
<title>.labels()</title>
<desc>Finds all label elements associated with the first selected element.</desc>
<longdesc>
<p>This can be used to find all the <code>&lt;label&gt;</code> elements associated with an <code>&lt;input&gt;</code> element. The association can be through nesting, where the label is an ancestor of the input, or through the <code>for</code> attribute on the label, pointing at the <code>id</code> attribute of the input. If no labels are associated with the given element, an empty jQuery object is returned.</p>
<p>This methods mimics the native <code>labels</code> property, which isn't supported in all browsers. In addition, this method also works for document fragments.</p>
</longdesc>
<signature>
<added>1.12</added>
</signature>
<example>
<height>100</height>
<desc>Highlight all labels of the input element</desc>
<code><![CDATA[
$( "input" ).labels().addClass( "ui-state-highlight" )
]]></code>
<html><![CDATA[
<label>
Firstname
<input id="name">
</label>
<label for="name">Please enter your name</label>
]]></html>
</example>
<category slug="methods"/>
<category slug="overrides"/>
<category slug="utilities"/>
</entry>
2 changes: 1 addition & 1 deletion entries/position.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<p>This is a standalone jQuery plugin and has no dependencies on other jQuery UI components.</p>
<xi:include href="../includes/core-extension-desc.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
</longdesc>
<added>1.8</added>
<signature>
<added>1.8</added>
<argument name="options" type="Object">
<property name="my" default='"center"'>
<desc>Defines which position <strong>on the element being positioned</strong> to align with the target element: "horizontal vertical" alignment. A single value such as <code>"right"</code> will be normalized to <code>"right center"</code>, <code>"top"</code> will be normalized to <code>"center top"</code> (following CSS convention). Acceptable horizontal values: <code>"left"</code>, <code>"center"</code>, <code>"right"</code>. Acceptable vertical values: <code>"top"</code>, <code>"center"</code>, <code>"bottom"</code>. Example: <code>"left top"</code> or <code>"center center"</code>. Each dimension can also contain offsets, in pixels or percent, e.g., <code>"right+10 top-25%"</code>. Percentage offsets are relative to the element being positioned.</desc>
Expand Down