开发者

Math with 5 Star Rating and Width

开发者 https://www.devze.com 2023-03-17 14:43 出处:网络
Right Now I have a 5 star rating wi开发者_如何学Goth values ranging from 1-5. Behind these empty stars is a box whose width will be depending on the values of the votes. The width of the 5 stars = 150

Right Now I have a 5 star rating wi开发者_如何学Goth values ranging from 1-5. Behind these empty stars is a box whose width will be depending on the values of the votes. The width of the 5 stars = 150px. This means that if two people vote both with 2.5 stars I want the width of the background div to be 75px and so on. Anyone have an equation to go by?


var width = stars * 30;

:)

shouldn't 3-stars have a width of 90, not 75?

0

精彩评论

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