.css(‘width’) and .css(‘height’) versus .width() and .height()

前端 未结 10 892
旧时难觅i
旧时难觅i 2021-01-07 19:44

Guys I\'ve been asking around and nobody can really tell me the benefits of using .css(‘width’) and .css(‘height’) rather than .width()

10条回答
  •  悲&欢浪女
    2021-01-07 20:02

    .width returns a unitless value, where as .css("width") returns the css value, width should be used with mathematical calculations

    http://api.jquery.com/width/

提交回复
热议问题