get CSS rule's percentage value in jQuery

后端 未结 12 1347
一个人的身影
一个人的身影 2020-11-22 08:22

Let\'s say the rule is as follows:

.largeField {
    width: 65%;
}

Is there a way to get \'65%\' back somehow, and not the pixel value?

12条回答
  •  终归单人心
    2020-11-22 08:46

    I have a similar issue in Getting values of global stylesheet in jQuery, eventually I came up with the same solution as above.

    Just wanted to crosslink the two questions so others can benefit from later findings.

提交回复
热议问题