开发者

show rating average from database with jquery rating plugin

So I was able to make it work, nothing diffic开发者_开发百科ult however I have a small problem. if the tutorial/article has a rating of 5 then 5 stars will be yellow, same if it is a rating of 4 or 3. But when the rating is 0 it will still make the first star yellow instead of making them all grey.

I'm using the plugin found on http://zensoftware.org/archives/483

and here is a link to a text file containing the code -> http://cmstutorials.org/code.txt

I don't think it's because of the plugin because when I remove the attribute selected="selected" all the stars become grey. so I guess it's something with my code


It might be the ceil function. If the rating is greater than zero but less than one, ceiling will return one, the smallest integer greater than the input. For a rating system I would expect that you would really want to use floor -- the largest integer not greater than the input. That way to get a rating of 5, you'd have to get all 5's.

Having said that, if this is still happening with no ratings whatsoever then what I've said above is moot.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜