โค้ด: เลือกทั้งหมด
//---ส่วนที่อยากให้แสดงรูปแถวละ 3 รูป
var tpl = $('<div class="row working">\n\
<div class="col-md-4 row_1"></div><div class="col-md-4 row_2"></div><div class="col-md-4 row_3"></div></div> ');
tpl.find('.row_'+row).append('<div class="row">\n\
<div class="col-md-12"><img src="uploads/before/cat-world.jpg" style="width:100%"></div>\n\
<div class="col-md-12"><p></p></div>');
tpl.find('p').text(data.files[0].name);
//-----------------------------
// Append the file name and file size
// Add the HTML to the UL element
data.context = tpl.appendTo(ul);
// Initialize the knob plugin
tpl.find('input').knob();
// Listen for clicks on the icons.png to remove
tpl.find('span').click(function(){
if(tpl.hasClass('working')){
jqXHR.abort();
}
tpl.fadeOut(function(){
tpl.remove();
});
});');
// tpl.find('p').text("");
}else{
var tpl = $('<li class="working"><input type="text" value="0" data-width="48" data-height="48"'+
' data-fgColor="#0788a5" data-readOnly="1" data-bgColor="#fff" /><div class="row"><div class="col-md-4"><p></p></div><div class="col-md-3 aft'+id_upload+'"></div><div class="col-md-2 download'+id_upload+'"></div><div class="col-md-1"><span></span></div></div></li>');
tpl.find('p').text(data.files[0].name)
.append('<i>Size 60x60<br><div style="color:#ff29e6;">'+formatFileSize(data.files[0].size)+'</div></i>');
}
// Append the file name and file size
// Add the HTML to the UL element
data.context = tpl.appendTo(ul);
// Initialize the knob plugin
tpl.find('input').knob();
// Listen for clicks on the icons.png to remove
tpl.find('span').click(function(){
if(tpl.hasClass('working')){
jqXHR.abort();
}
tpl.fadeOut(function(){
tpl.remove();
});
});