Padding or margin value in pixels as integer using jQuery

后端 未结 14 2211
陌清茗
陌清茗 2020-11-28 02:40

jQuery has height() en width() functions that returns the height or width in pixels as integer...

How can I get a padding or margin value of an element in p

14条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-28 03:12

    The parseInt function has a "radix" parameter which defines the numeral system used on the conversion, so calling parseInt(jQuery('#something').css('margin-left'), 10); returns the left margin as an Integer.

    This is what JSizes use.

提交回复
热议问题