From bb05db32438f676a5d9418f2de7d5af179b23394 Mon Sep 17 00:00:00 2001
From: Arthur Verschaeve By default, jQuery adds a "px" unit to the values passed to the By default, jQuery adds a "px" unit to the values passed to the You can think about The keys of the By default the object contains the following properties:Special units
- .css()
method. This behavior can be prevented by adding the property to the jQuery.cssNumber
object.css()
method. This behavior can be prevented by adding the property to the jQuery.cssNumber
object
diff --git a/entries/jQuery.cssNumber.xml b/entries/jQuery.cssNumber.xml
new file mode 100644
index 00000000..ce5af886
--- /dev/null
+++ b/entries/jQuery.cssNumber.xml
@@ -0,0 +1,33 @@
+
+
$.cssNumber.someCSSProp = true;
.css()
method uses this object to see if it may append px
to unitless values.jQuery.cssNumber
as a list of all CSS properties you might use without a unit. It's used by .css()
to determine if it needs to add px
to unitless values.jQuery.cssNumber
object are camel-cased and the values are all set to true
. If you want to prevent the .css()
method from automatically adding the px
unit for a specific CSS property, you can add an extra property to the jQuery.cssNumber
object.
+
+jQuery.cssNumber.someCSSProp = true;
+
+
+ zIndex
fontWeight
opacity
zoom
lineHeight
widows
(added in jQuery 1.6)orphans
(added in jQuery 1.6)fillOpacity
(added in jQuery 1.6.2)columnCount
(added in jQuery 1.9)order
(added in jQuery 1.10.2)flexGrow
(added in jQuery 1.11.1)flexShrink
(added in jQuery 1.11.1)