0
我玩星級插件,但我不能正確配置,顯示懸停標籤上的右側,這樣頁面上的測試-3B:jQuery的星級插件
http://www.fyneworks.com/jquery/star-rating/#tab-Testing
<script>
$(function(){
$('.star').rating({
focus: function(value, link){
// 'this' is the hidden form element holding the current value
// 'value' is the value selected
// 'element' points to the link element that received the click.
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>
<input type="radio" name="rating" value="1" style="margin: 0;" class="star" title="Very poor"/>
<input type="radio" name="rating" value="2" style="margin: 0;" class="star" title="Poor"/>
<input type="radio" name="rating" value="3" style="margin: 0;" class="star" title="OK"/>
<input type="radio" name="rating" value="4" style="margin: 0;" class="star" title="Good"/>
<input type="radio" name="rating" value="5" style="margin: 0;" class="star" title="Very good"/>
<span id="hover-test" style="margin:0 0 0 20px;">Hover tips will appear in here</span><br />