Guest User

Untitled

a guest
Jan 18th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. $('.stars_small').raty({
  2. readOnly : true,
  3. half : true,
  4. score : 2,
  5. space : false
  6. });
  7.  
  8. <div class="stars_small"></div>
  9.  
  10. $('.stars_small').each(function() {
  11.  
  12. $(this).raty({
  13. readOnly : true,
  14. half : true,
  15. score : 2,
  16. space : false
  17. });
  18. });
  19.  
  20. // lines of JS generated with a loop in PHP (for the rate content)
  21. var rates = [];
  22. rates.push({...one rate coming from PHP...});
  23. rates.push({...one rate coming from PHP...});
  24. // etc...
  25.  
  26. $(document).ready(function() {
  27.  
  28. $(".starts_small").each(function(index, element) {
  29.  
  30. $(this).raty(rates[index]);
  31.  
  32. });
  33.  
  34. });
Add Comment
Please, Sign In to add comment