首页
话题
消息
手册
我的
返回介绍

jQuery.cssNumber

发布于 2017-09-11 字数1756 浏览 990 评论 0

所属分类:CSS | DOM 操作 > CSS 属性

jQuery.cssNumberReturns: Object

Description: An object containing all CSS properties that may be used without a unit. The .css() method uses this object to see if it may append px to unitless values.

  • version added: 1.4.3jQuery.cssNumber

You can think about 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.

The keys of the 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;

By default the object contains 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)

您暂时不能评论!

管理员开启了需要登录才能够评论,你可以免费注册一个本站的账号。

还没有评论!

目前还没有任何评论,快来抢沙发吧!