daily pastebin goal
56%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top