I have tried using two bar rating plugins, one of them found here: the other, here. Using the first listed rating plugin, when I mouse over the stars, they don't work at all (meaning the color of the selected stars don't change) while in the KnockoutJS loop, if outside, it works perfectly fine. Sample code:
<ul data-bind="foreach: articles">
<li>
<input type="radio" name="1" class="star" />
<input type="radio" name="1" class="star" />
<input type="radio" name="1" class="star" />
<input type="radio" name="1" class="star" />
<input type="radio" name="1" class="star" />
<script type="text/javascript">
$(function(){ // wait for document to load
$('input.star').rating();
});
</script>
</li>
</ul>
<!-- Works -->
My CSS is setup and I even tried moving the plugin activation script inside/outside the loop and nothing.
Aucun commentaire:
Enregistrer un commentaire