EineyEntertainment Posted March 11, 2009 Posted March 11, 2009 For power training, I allow memebers to raise will up to 500%, yet with the will increase, so does the will bar. Can someone tell me a way to prevent the bar from going over 100%, yet allowing the actual number to raise up to 500? Ty in advance Quote
POG1 Posted March 11, 2009 Posted March 11, 2009 Re: Limiting how big your will bar grows I haven't tried it but you could use 2 divs.. PHP echo '<div class="outerBar">'. '<div class="innerBar" style="width:'.(($ir['will'] / $ir['maxwill']) * 100).'%;"></div>'. '</div>'; CSS div.outerBar { background:#900;width:150px;overflow:hide; } div.innerBar { background:#090; } div.innerBar, div.outerBar { height:5px;margin:0;padding:0; } Quote
Cronus Posted March 11, 2009 Posted March 11, 2009 Re: Limiting how big your will bar grows Just make an if statement to do it. $checkwill=$ir['will']/$ir['maxwill']; if($checkwill >= 1) { print"full will bar"; } if($checkwill < 1) { print"necessary will bar"; } Obviously this isn't exact. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.