matty Posted May 1, 2007 Share Posted May 1, 2007 Hi, Im trying to create a bar that will work like this... -100 0 100 ------------------------- I currently have bars that are 0 to 100 for example 30/100 pieces of fruit, I want one like the above sort of like an alignment bar good/evil if you are fully evil you have -100 etc. $totalway = ($alignment/100)*100; $totalaway = 100-$totalway; That is what I have, that will do 0/100, assuming $alignment is -30 it will only extend the bar by 30pixels, i want the bar to come from the other way by 30... and the other direction if its positive. Many thanks, Matt Link to comment https://forums.phpfreaks.com/topic/49433-percentage-bar-help/ Share on other sites More sharing options...
Thierry Posted May 1, 2007 Share Posted May 1, 2007 Might be better to use two images in two TD cells, the left cell have its image aligned to the right and the right cell having its image aligned to left. Link to comment https://forums.phpfreaks.com/topic/49433-percentage-bar-help/#findComment-242242 Share on other sites More sharing options...
matty Posted May 1, 2007 Author Share Posted May 1, 2007 I am using to different images for this. echo "<img src=image/main/sbarend.jpg width=1px height=5><img src=image/main/sbardrunk2.jpg width=$totalway height=5><img src=image/main/sbardrunk.jpg width=$totalaway height=5><img src=image/main/sbarend.jpg width=1px height=5><br/>"; Link to comment https://forums.phpfreaks.com/topic/49433-percentage-bar-help/#findComment-242252 Share on other sites More sharing options...
matty Posted May 1, 2007 Author Share Posted May 1, 2007 bump Link to comment https://forums.phpfreaks.com/topic/49433-percentage-bar-help/#findComment-242306 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.