jQuery.cssNumberProperty

jQuery 属性jQuery Property

Definition and Usage

$.cssNumber refers to an object containing all CSS properties that can be used without units.

Tip:Used by .css() to determine whether px needs to be appended to unitless values.

By default, this object contains the following properties:

zIndex

fontWeight

opacity

zoom

lineHeight

widows (jQuery 1.6开始添加)

orphans (jQuery 1.6开始添加)

fillOpacity (jQuery 1.6.2开始添加)

columnCount (jQuery 1.9开始添加)

order (jQuery 1.10.2开始添加)

flexGrow (jQuery 1.11.1开始添加)

flexShrink (jQuery 1.11.1开始添加)

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

jQuery.cssNumber.someCSSProp = true;

Syntax

$.cssNumber


jQuery 属性jQuery Property

Other Extensions