Width in % instead of px
Width in % instead of px
This code:
-
$(".selector").each(function (i) {
var capacity = Math.round($(this).text().replace(/\,/,""));
$(this).width(capacity);
}).fadeIn(2000);
..returns width in px, how can I modify it to use percentage?
Thanks