jquery - Set width no higher than 100% -
jquery - Set width no higher than 100% -
how set width
never goes higher 100% based on variable value?
var progbarvalue = $(this).find('.days-due').text(); $(this).find('.bar').width(progbarvalue +"%");
i need width
value clamp maximum of 100%.
for example: if progbarvalue returns 250% width
still 100%.
i think have modify variable since width attribute can >100%.
var progbarvalue = $(this).find('.days-due').text(); progbarvalue = progbarvalue > 100 ? 100 : progbarvalue; $(this).find('.bar').width(progbarvalue +"%");
jquery
Comments
Post a Comment