Untested, but I am fairly certain that you need to either use a block level element such as a paragraph tag or try setting strong to display:block.

-Marshall


AllexS wrote:
<!-- Before bargraph plugin is applied -->
<div class="graph">
     22
</div>
<div class="graph">
     89
</div>

<!-- Fairly basic function -->
jQuery.fn.bargraph = function() {
     return this.each(function(){
          var temp = $(this).text();
          var span = '<span>' + temp + '%' + '</span>';
          var bar = '<strong class="bar"></strong>';
          $(this).html(span);
          $(this).find('span').wrap(bar);
          $(this).find('strong').width(temp+'%');
     });
};

<!-- What I end up with -->
<div class="graph">
     <strong class="bar" style="">
          <span> 22 %</span>
     </strong>
</div>
<div class="graph">
     <strong class="bar" style="">
          <span> 89 %</span>
     </strong>
</div>

Why is width never applied?
I've tried stringing it together as well with the same result.
Any ideas?



Reply via email to