javascript 带有部分星星的 jQuery 星级评定系统

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6304531/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 20:15:20  来源:igfitidea点击:

jQuery star rating system with partial stars

javascriptjqueryhtml

提问by denisq

I need your advice, google is not helping me out on that one. I need a star rating system for my website BUT it should be capable of displaying an initial value with decimals (2.75 -> displaying 3/4 of a star) and the input should only allow integers. I found no script that combines both features. Do you have any idea?

我需要你的建议,谷歌并没有帮助我解决这个问题。我的网站需要一个星级评分系统,但它应该能够显示带小数的初始值(2.75 - > 显示 3/4 的星)并且输入应该只允许整数。我没有发现结合了这两个功能的脚本。你有什么主意吗?

The best would be a ready-made jquery plugin.

最好的是现成的 jquery 插件。

Kind regards, Quentin

亲切的问候,昆汀

采纳答案by denisq

Thanks for your answers. However, RateItwas the only one that could show me a preset float value in a partial star and rate with a full star:

感谢您的回答。但是,RateIt是唯一一个可以向我显示部分星级的预设浮点值和全星级的比率:

<div class="rateit" data-rateit-value="2.76" data-rateit-step="1" data-rateit-resetable="false" >

回答by Tomasz Kowalczyk

As you wish:

如你所愿:

http://www.fyneworks.com/jquery/star-rating/

http://www.fyneworks.com/jquery/star-rating/

Seems to be capable of doing such things.

似乎有能力做这样的事情。

回答by John

This might help you. A list of the top 10 rating plugins for jqueryand this onein particular for you fractions.

这可能对你有帮助。该名单前10名的评价插件的jQuery这一个特别为你分数。

回答by Mauricio

This one worked for me. Maybe you should give a look cdn.webdeveloperswall.com/demo/css-star-rating/

这个对我有用。也许你应该看看cdn.webdeveloperswall.com/demo/css-star-rating/

回答by abhijit

Use this best star rating plugin..i used it with no issues. Raty

使用这个最好的星级评分插件..我使用它没有问题。 拉蒂