Using an integer to show a % of an image over another

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
smcallister
Forum Newbie
Posts: 2
Joined: Fri May 23, 2008 9:48 am

Using an integer to show a % of an image over another

Post by smcallister »

Ok, so I have a value in the range from 1 to 10... For this example, let's say it's 6.5 out of 10. I've been trying to figure out a way to display that graphically using stars like the way IMDB does... which uses this graphic

Image

On IMDB, they are able to use that image alone to show 65% of the gold stars over 100% of the silver stars to create this effect:

ImageImageImageImageImageImageImageImageImageImage

only difference is, they are able to actually show that 1/2 or 1/4 star with some type of overlay image. Can anyone help me along with this? If I have confused you, let me know.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Using an integer to show a % of an image over another

Post by RobertGonzalez »

You could probably do this with some simple CSS.
Post Reply