Skip to content

Commit 1275125

Browse files
committed
jQuery.cssNumber: Add if surrounding the assignment to jQuery.cssNumber
1 parent ba68919 commit 1275125

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

entries/jQuery.cssNumber.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
<p>You can think about <code>jQuery.cssNumber</code> as a list of all CSS properties you might use without a unit. Prior to jQuery 4.0, it was used by <a href="/css/"><code>.css()</code></a> to determine if it needs to add <code>px</code> to unitless values.</p>
1313
<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 and that property is not yet a key of the <code>jQuery.cssNumber</code> object, you can add such an extra property:</p>
1414
<pre><code>
15-
jQuery.cssNumber.someCSSProp = true;
15+
if ( jQuery.cssNumber ) {
16+
jQuery.cssNumber.someCSSProp = true;
17+
}
1618
</code></pre>
1719
</longdesc>
1820
<category slug="css"/>

0 commit comments

Comments
 (0)