Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- design_images.push({cid:designImg});
- var counter = 0;
- $(design_images).load(function() { // many or just one image(w) inside body or any other container
- counter += 1;
- }).each(function(key, value) {
- this.complete && $(this).load();
- console.log(value);
- });
- function matte_design_change_design_type(element)
- {
- var element_value = null;
- var mattes_selected_type = get_mattes_selected_type();
- matte_design_widths[mattes_selected_type] = [];
- var mattes_selected_design = get_mattes_selected_design();
- var count_matte_designs = 0;
- var found = false;
- $(document).ready(function()
- {
- $.ajax(
- {
- type: "GET",
- url: SITE_URL + "/system/components/xml/" + mattes_selected_type,
- dataType: 'xml',
- success: function(xml)
- {
- var output = [];
- var design_images = [];
- $('component', xml).each(function(i, el)
- {
- matte_design_widths[mattes_selected_type][i] = 0;
- count_matte_designs++;
- var thumb = $("thumb", this).text(),
- cid = $("cid", this).first().text(),
- name = $("name", this).first().text().replace("Collage - ", ""),
- alt = name,
- description = $("description", this).first().text(),
- if (parseInt(cid, 10) === mattes_selected_design)
- {
- found = true;
- $("#matte_design_name").html(name);
- $("#matte_design_description").html(description);
- }
- var designImg = new Image();
- designImg.id = 'cid_' + cid;
- designImg.alt = alt;
- designImg.onclick = function() {
- matte_design_change(cid, mattes_selected_type);
- };
- designImg.onload = function() {
- output.push('<span class="matte_design_image_name" id="design_' + cid + '"><img id="cid_' + cid + '" />');
- output.push('<br /><span class="matte_design_name" id="matte_design_name_' + mattes_selected_type + '_' + i + '">' + name + '</span></span>');
- matte_design_increase_width(mattes_selected_type, this.width, i);
- $('#matte_designs_strip_wrapper').html(output.join(''));
- };
- designImg.src = 'https://example.com/system/components/compimg/' + thumb + '/flashthumb';
- });
- var counter = 0;
- var size = $('img').length;
- $(design_images).load(function() {
- counter += 1;
- }).each(function(key, value) {
- this.complete && $(this).load();
- console.log(value);
- });
- }
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement