Skip to content

Commit 0c6b0fb

Browse files
committed
jQuery.cssNumber: add new entry
Fixes gh-164 Closes gh-693
1 parent c3dd543 commit 0c6b0fb

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

entries/jQuery.cssHooks.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ if ( $.support.someCSSProp && $.support.someCSSProp !== "someCSSProp" )
163163
})( jQuery );
164164
</code></pre>
165165
<h4 id="special-units">Special units</h4>
166-
<p>By default, jQuery adds a "px" unit to the values passed to the <code>.css()</code> method. This behavior can be prevented by adding the property to the <code>jQuery.cssNumber</code> object</p>
166+
<p>By default, jQuery adds a "px" unit to the values passed to the <code>.css()</code> method. This behavior can be prevented by adding the property to the <a href="/jQuery.cssNumer/"><code>jQuery.cssNumber</code></a> object</p>
167167
<pre><code>
168168
$.cssNumber.someCSSProp = true;
169169
</code></pre>

entries/jQuery.cssNumber.xml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0"?>
2+
<entry type="property" name="jQuery.cssNumber" return="Object">
3+
<title>jQuery.cssNumber</title>
4+
<signature>
5+
<added>1.4.3</added>
6+
</signature>
7+
<desc>An object containing all CSS properties that may be used without a unit. The <a href="/css/"><code>.css()</code></a> method uses this object to see if it may append <code>px</code> to unitless values.</desc>
8+
<longdesc>
9+
<p>You can think about <code>jQuery.cssNumber</code> as a list of all CSS properties you might use without a unit. It's used by <a href="/css/"><code>.css()</code></a> to determine if it needs to add <code>px</code> to unitless values.</p>
10+
<p>The keys of the <code>jQuery.cssNumber</code> object are camel-cased and the values are all set to <code>true</code>. If you want to prevent the <a href="/css/"><code>.css()</code></a> method from automatically adding the <code>px</code> unit for a specific CSS property, you can add an extra property to the <code>jQuery.cssNumber</code> object.</p>
11+
<pre><code>
12+
jQuery.cssNumber.someCSSProp = true;
13+
</code></pre>
14+
<p>By default the object contains the following properties:</p>
15+
<ul>
16+
<li><code>zIndex</code></li>
17+
<li><code>fontWeight</code></li>
18+
<li><code>opacity</code></li>
19+
<li><code>zoom</code></li>
20+
<li><code>lineHeight</code></li>
21+
<li><code>widows</code> (added in jQuery 1.6)</li>
22+
<li><code>orphans</code> (added in jQuery 1.6)</li>
23+
<li><code>fillOpacity</code> (added in jQuery 1.6.2)</li>
24+
<li><code>columnCount</code> (added in jQuery 1.9)</li>
25+
<li><code>order</code> (added in jQuery 1.10.2)</li>
26+
<li><code>flexGrow</code> (added in jQuery 1.11.1)</li>
27+
<li><code>flexShrink</code> (added in jQuery 1.11.1)</li>
28+
</ul>
29+
</longdesc>
30+
<category slug="css"/>
31+
<category slug="manipulation/style-properties"/>
32+
<category slug="version/1.4.3"/>
33+
</entry>

0 commit comments

Comments
 (0)