我正在实施jquery star rating plugin。
单星影响工作正常,没问题。 但我似乎无法让半个明星工作......
html来源:
<div class="stars">
<span class="star-rating-control"><div class="rating-cancel" style="display: none;"><a title="Cancel Rating"></a></div><div role="text" aria-label="" class="star-rating rater-0 required {half:true} star-rating-applied star-rating-live" id="Answer1_Rating"><a title="1">1</a></div><div role="text" aria-label="" class="star-rating rater-0 required {half:true} star-rating-applied star-rating-live" id="Answer1_Rating"><a title="2">2</a></div><div role="text" aria-label="" class="star-rating rater-0 required {half:true} star-rating-applied star-rating-live" id="Answer1_Rating"><a title="3">3</a></div><div role="text" aria-label="" class="star-rating rater-0 required {half:true} star-rating-applied star-rating-live" id="Answer1_Rating"><a title="4">4</a></div><div role="text" aria-label="" class="star-rating rater-0 required {half:true} star-rating-applied star-rating-live" id="Answer1_Rating"><a title="5">5</a></div></span>
<input class="required {half:true} star-rating-applied" data-val="true" data-val-required="The Rating field is required." id="Answer1_Rating" name="Answer1.Rating" type="radio" value="1" style="display: none;">
<input class="required {half:true} star-rating-applied" id="Answer1_Rating" name="Answer1.Rating" type="radio" value="2" style="display: none;">
<input class="required {half:true} star-rating-applied" id="Answer1_Rating" name="Answer1.Rating" type="radio" value="3" style="display: none;">
<input class="required {half:true} star-rating-applied" id="Answer1_Rating" name="Answer1.Rating" type="radio" value="4" style="display: none;">
<input class="required {half:true} star-rating-applied" id="Answer1_Rating" name="Answer1.Rating" type="radio" value="5" style="display: none;">
</div>
Jquery的:
$('.stars :radio').rating();
答案 0 :(得分:3)
来自http://www.fyneworks.com/jquery/star-rating/:
使用元数据插件通过class属性将高级设置传递给插件。
答案 1 :(得分:0)