Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. design_images.push({cid:designImg});
  2.  
  3. var counter = 0;
  4. $(design_images).load(function() { // many or just one image(w) inside body or any other container
  5. counter += 1;
  6.  
  7. }).each(function(key, value) {
  8. this.complete && $(this).load();
  9. console.log(value);
  10. });
  11.  
  12. function matte_design_change_design_type(element)
  13. {
  14. var element_value = null;
  15. var mattes_selected_type = get_mattes_selected_type();
  16.  
  17. matte_design_widths[mattes_selected_type] = [];
  18. var mattes_selected_design = get_mattes_selected_design();
  19. var count_matte_designs = 0;
  20. var found = false;
  21. $(document).ready(function()
  22. {
  23. $.ajax(
  24. {
  25. type: "GET",
  26. url: SITE_URL + "/system/components/xml/" + mattes_selected_type,
  27. dataType: 'xml',
  28. success: function(xml)
  29. {
  30. var output = [];
  31. var design_images = [];
  32.  
  33. $('component', xml).each(function(i, el)
  34. {
  35. matte_design_widths[mattes_selected_type][i] = 0;
  36. count_matte_designs++;
  37. var thumb = $("thumb", this).text(),
  38. cid = $("cid", this).first().text(),
  39. name = $("name", this).first().text().replace("Collage - ", ""),
  40. alt = name,
  41. description = $("description", this).first().text(),
  42.  
  43. if (parseInt(cid, 10) === mattes_selected_design)
  44. {
  45. found = true;
  46. $("#matte_design_name").html(name);
  47. $("#matte_design_description").html(description);
  48. }
  49.  
  50.  
  51.  
  52. var designImg = new Image();
  53. designImg.id = 'cid_' + cid;
  54. designImg.alt = alt;
  55. designImg.onclick = function() {
  56. matte_design_change(cid, mattes_selected_type);
  57. };
  58. designImg.onload = function() {
  59. output.push('<span class="matte_design_image_name" id="design_' + cid + '"><img id="cid_' + cid + '" />');
  60. output.push('<br /><span class="matte_design_name" id="matte_design_name_' + mattes_selected_type + '_' + i + '">' + name + '</span></span>');
  61. matte_design_increase_width(mattes_selected_type, this.width, i);
  62.  
  63. $('#matte_designs_strip_wrapper').html(output.join(''));
  64. };
  65. designImg.src = 'https://example.com/system/components/compimg/' + thumb + '/flashthumb';
  66.  
  67. });
  68.  
  69.  
  70. var counter = 0;
  71. var size = $('img').length;
  72. $(design_images).load(function() {
  73. counter += 1;
  74.  
  75. }).each(function(key, value) {
  76. this.complete && $(this).load();
  77. console.log(value);
  78. });
  79. }
  80. });
  81. });
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement