I am playing with star rating plugin, but I can't configure it correctly, to show hover label on the right side, like on this page Test-3B:
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=开发者_StackOverflow社区"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 />
I tried your plugin and it works great.
I put the source code here : http://jsfiddle.net/VgWtG/
You can test it by yourself.
For your code, try to put <script type='text/javascript'>
instead of </script>
. Then, surround your set of inputs with a div
.
But i'm pretty sure that your problem comes from a missing include (check it in the source code I gave you). Regards.
精彩评论