javascript - Bootstrap popover replicating code -


i using raty perform rating functionality , showing inside popover.

the problem first time click on link, correctly create stars but, when click second time, stars replicated, popups 10 stars instead of 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')         });     }); }); 

i replicate error in fiddle.

can let me know how fix this, and, therefore, show 5 stars?

thanks!!!!

i not overly familiar raty, seems need destroy existing before running code second, or third time.

$(this).raty('destroy'); 

something that, check raty doc exact implimentation


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -