如何width根据变量值进行设置,使其永远不会高于 100%?
var progBarValue = $(this).find('.days-due').text();
$(this).find('.bar').width(progBarValue +"%");
我需要将该width值限制为最大 100%。
例如:如果 progBarValue 返回 250%,width则仍将是 100%。
如何width根据变量值进行设置,使其永远不会高于 100%?
var progBarValue = $(this).find('.days-due').text();
$(this).find('.bar').width(progBarValue +"%");
我需要将该width值限制为最大 100%。
例如:如果 progBarValue 返回 250%,width则仍将是 100%。