我正在使用这个jQuery Star Rating 插件
它正在工作,但我试图让悬停提示在单击后留在页面上。目前,在您单击并将鼠标移开后它会消失。
<script>
$(function(){
$('.hover-star').rating({
focus: function(value, link){
var tip = $('#hover-test');
tip[0].data = tip[0].data || tip.html();
tip.html(link.title || 'value: '+value);
},
blur: function(value, link){
var tip = $('#hover-test');
$('#hover-test').html(tip[0].data || '');
}
});
</script>
<form id="ratingform">
<table width="100%" cellspacing="10">
<tr><Td>Hover over the stars and then click</td></tr>
<tr>
<td valign="top" width="">
<div class="Clear">
<div>
<input class="hover-star" type="radio" name="rating" value="1" title="Very poor"/>
<input class="hover-star" type="radio" name="rating" value="2" title="Poor"/>
<input class="hover-star" type="radio" name="rating" value="3" title="OK"/>
<input class="hover-star" type="radio" name="rating" value="4" title="Good"/>
<input class="hover-star" type="radio" name="rating" value="5" title="Very Good"/>
<span id="hover-test" style="margin:0 0 0 20px;"></span>
</td>
</tr>
</table>