【发布时间】:2014-03-06 12:28:43
【问题描述】:
我正在使用 raty 来执行评分功能,并在弹出框内显示它。
问题是我第一次点击链接时,它正确地创建了星星,但是当我第二次点击时,星星被复制了,所以它弹出了 10 颗星星而不是 5 颗。
$('#member1').popover({
html: true,
placement: 'bottom',
content: function() {
return $($(this).data('contentwrapper')).html();
}
}).click(function() {
$('.star').each(function(el) {
$(this).raty({
starOff : 'http://wbotelhos.com/raty/lib/images/star-off.png',
starOn : 'http://wbotelhos.com/raty/lib/images/star-on.png',
start: $(this).attr('data-rating')
});
});
});
我在这个fiddle 中复制了错误。
谁能告诉我如何解决这个问题,因此只显示 5 颗星?
谢谢!!!!
【问题讨论】:
标签: javascript jquery twitter-bootstrap popover rate