path = path.replace(file, GlobalFileImg);
var extImgLow = ".jpg";
var extImgUP = ".JPG";
$.ajax({
url: path,
async: false,
cache: false,
success: function (data) {
$(data).find(('a:contains(' + extImgLow + ')') || ('a:contains(' + extImgUP + ')')).each(function (index, value) {
var filename = this.href.replace(window.location.host, "").replace("
http:///", "");
//on line change to GlobalPathImg+filename
console.log(value);
var idx = filename;
idx = idx.substr(idx.lastIndexOf("/") + 1, idx.length).replace(prefixfile, '').replace(extImgLow, '');
loadSeqImg(filename, id, idx);
});
function loadSeqImg(filename, id, idx){
var img = $("<img />").attr('src', filename).load(function () {
if (this.complete) {
console.log("Complete: " + filename + " Idx: " + idx + " id: " + id);
//get the physicalHeight and width
}
}
output:
Each:ImgTxtArtMouv/imgs/am23.jpg
Each:/ImgTxtArtMouv/imgs/am24.jpg
Each:/ImgTxtArtMouv/imgs/am25.jpg
Each:/ImgTxtArtMouv/imgs/am26.jpg
Each:/ImgTxtArtMouv/imgs/am27.jpg
Here the load is asynchrone, how to make it ordered.
Complete: ImgTxtArtMouv/imgs/am23.jpg
Complete: ImgTxtArtMouv/imgs/am24.jpg
Complete: ImgTxtArtMouv/imgs/am26.jpg
Complete: ImgTxtArtMouv/imgs/am27.jpg
Complete: ImgTxtArtMouv/imgs/am25.jpg