![]() |
| ||
| starrating http://www.masugadesign.com/the-lab/...ar-rating-bar/ Does anyone know how I could do a top 10 list within a table that has every second "table" in diferent colors with different pictures that will show up based up on the rating is an odd or even number (1=blue 2= grey, 3,=blue, ect.) Look at this picture if it doesnt make sense http://www.pokerdream.tk/lookhere.jpg |
| ||
| Re: starrating As you are iterating through the table, count rows. If the row number is odd, make it blue. If not, make it grey. |
| ||
| Re: starrating Hmm.. can it be so simple? To me, when I see the "toplist"-code I feel it could be alot harder (??). |
| ||
| Re: starrating Whoops! I'm sorry I misread your problem. But the solution (to what I think you want to do) isn't too far off. As you are reading through the list of Top 10, divide the rating by 2. If the result comes out as an integer, the rating was EVEN. (0, 2, 4, 6, 8 or 10). If the result has a fractional part the rating will be ODD (1, 3, 5, 7, 9 - these numbers are not equally divisible by 2). As you get this even/odd information, set it to a variable--say a boolean variable. If the variable is true, then color the table one way (say blue for even) and if it is false, then color the table the other way (say grey for odd). |
| ||
| Re: starrating Hmm.. How can I do that - I'm not the best programmer.. ?? |
| ||
| Re: starrating Can someone help me ? |
| ||
| Re: starrating Integer division: a = Math.floor(b/2); Test for odd: a = Math.floor(b/2); |
| ||
| Re: starrating thank you, I'll see if I can make it right in someway- |
| All times are GMT -4. The time now is 9:21 am. |
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC