Easy Tutorial
❮ Jquery Events Jq Event Timestamp ❯

jQuery.cssNumber Property

jQuery Properties

Definition and Usage

$.cssNumber refers to an object that contains all CSS properties that do not require units.

Tip: Used with .css() to determine if the px unit needs to be appended to unitless values.

By default, this object includes the following properties:

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)

To prevent the .css() method from automatically adding the px unit to specific CSS properties, you can add an additional property to the jQuery.cssNumber object.

jQuery.cssNumber.someCSSProp = true;

Syntax


jQuery Properties

❮ Jquery Events Jq Event Timestamp ❯