RSS Forums RSS
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1554 | Replies: 7
Reply
Join Date: Jun 2006
Posts: 41
Reputation: ytregnn is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
ytregnn ytregnn is offline Offline
Light Poster

Troubleshooting starrating

  #1  
May 30th, 2007
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2006
Location: NY
Posts: 199
Reputation: Dukane is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 15
Dukane's Avatar
Dukane Dukane is offline Offline
Junior Poster

Re: starrating

  #2  
May 30th, 2007
As you are iterating through the table, count rows. If the row number is odd, make it blue. If not, make it grey.
It is very important to read this: http://www.catb.org/~esr/faqs/smart-questions.html
Reply With Quote  
Join Date: Jun 2006
Posts: 41
Reputation: ytregnn is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
ytregnn ytregnn is offline Offline
Light Poster

Re: starrating

  #3  
Jun 6th, 2007
Hmm.. can it be so simple? To me, when I see the "toplist"-code I feel it could be alot harder (??).
Reply With Quote  
Join Date: Oct 2006
Location: NY
Posts: 199
Reputation: Dukane is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 15
Dukane's Avatar
Dukane Dukane is offline Offline
Junior Poster

Tutorial Re: starrating

  #4  
Jun 7th, 2007
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).
It is very important to read this: http://www.catb.org/~esr/faqs/smart-questions.html
Reply With Quote  
Join Date: Jun 2006
Posts: 41
Reputation: ytregnn is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
ytregnn ytregnn is offline Offline
Light Poster

Re: starrating

  #5  
Jul 29th, 2007
Hmm..

How can I do that - I'm not the best programmer..

??
Reply With Quote  
Join Date: Jun 2006
Posts: 41
Reputation: ytregnn is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
ytregnn ytregnn is offline Offline
Light Poster

Re: starrating

  #6  
Aug 7th, 2007
Can someone help me ?
Reply With Quote  
Join Date: Jan 2007
Posts: 2,640
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 118
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: starrating

  #7  
Aug 8th, 2007
Integer division:

a = Math.floor(b/2);

Test for odd:

a = Math.floor(b/2);
if(b - a*2 > .0001){
  // code if b is odd

}
else{
  // code if b is even

};
Daylight-saving time uses more gasoline
Reply With Quote  
Join Date: Jun 2006
Posts: 41
Reputation: ytregnn is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
ytregnn ytregnn is offline Offline
Light Poster

Re: starrating

  #8  
Aug 9th, 2007
thank you, I'll see if I can make it right in someway-
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 6:46 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC