stardropdown.js 844 B

12345678910111213141516171819202122232425262728293031323334
  1. $(document).ready(function()
  2. {
  3. $('#icon_count_input').change(function ()
  4. {
  5. var select_box = $('select#icon_image_input option:selected').val();
  6. var icon_count = $('#icon_count_input');
  7. if (icon_count.val() == 0 && select_box != 'blank.png')
  8. icon_count.val(1);
  9. if (icon_count.val().length > 2)
  10. icon_count.val(99);
  11. });
  12. $('#icon_image_input').change(function ()
  13. {
  14. refreshPreview();
  15. });
  16. function refreshPreview()
  17. {
  18. // Get the star count element.
  19. var icon_count = $('#icon_count_input');
  20. var select_box = $('select#icon_image_input').val();
  21. // If it's empty, set it to 1.
  22. if (icon_count.val() == 0 && select_box != 'blank.png')
  23. icon_count.val(1);
  24. // Update the star preview.
  25. $('#star_preview').attr('src', smf_default_theme_url + '/images/membericons/' + select_box);
  26. }
  27. refreshPreview();
  28. });