I have an example here in jsFiddle , jQuery currently sets the width as a fixed pixel width. Therefore, when the width of the browser decreases, the bars leave the screen to the right. My question is, how can I get jQuery to set width instead of percentage?
<div class="bars"> <div class="meter"> <span style="width: 88%"></span> </div> <div class="meter"> <span style="width: 62%"></span> </div> </div>
$(".meter > span").each(function() { $(this) .data("origWidth", $(this).width()) .width(0) .animate({ width: $(this).data("origWidth") }, 3600); });
source share