fix error

This commit is contained in:
邱博亞 2023-03-11 12:34:52 +08:00
parent 08ad4f3790
commit 1bd1a39132
1 changed files with 19 additions and 26 deletions

View File

@ -269,16 +269,6 @@ window.GalleryTheater = function() {
currentPic.image = albumData.images[0]; currentPic.image = albumData.images[0];
currentPic.index = 0; currentPic.index = 0;
setMainPic(); setMainPic();
isTheaterInitialized = false;
setTimeout(function() {
loadingProcess = 0;
nextPicLoading = 0;
$('.theaterButton').remove()
$("img.gallery-image.gal-prev.gal-inactive").remove();
img = $("img.gallery-image.gal-active");
img.eq(0).remove();
window.onhashchange()
}, 100)
} }
} }
} }
@ -439,21 +429,20 @@ window.GalleryTheater = function() {
if (direction == null) { if (direction == null) {
if (img.length==0){ if (img.length==0){
img = $("<img class='gallery-image gal-active'>"); img = $("<img class='gallery-image gal-active'>");
imageContainer.append(img);
}
img.hide(); img.hide();
img.attr("src", currentPic.image.file.theater.url); imageContainer.append(img);
img.attr("alt", currentPic.image.alt_title);
img.one("load", function() { img.one("load", function() {
one_load(img) one_load(img)
}) })
}
img.attr("src", currentPic.image.file.theater.url);
img.attr("alt", currentPic.image.alt_title);
isTheaterInitialized = true; isTheaterInitialized = true;
} else { } else {
if (selectedFromStrip) { if (selectedFromStrip) {
img = imageContainer.find(".gal-" + direction);
img.attr("src", currentPic.image.file.theater.url); img.attr("src", currentPic.image.file.theater.url);
img.attr("alt", currentPic.image.alt_title); img.attr("alt", currentPic.image.alt_title);
} }else{
if (direction == "next") { if (direction == "next") {
imageContainer.find(".gal-prev").remove(); imageContainer.find(".gal-prev").remove();
img.removeClass("gal-active").addClass("gal-prev gal-inactive temp"); img.removeClass("gal-active").addClass("gal-prev gal-inactive temp");
@ -465,6 +454,8 @@ window.GalleryTheater = function() {
imageContainer.find(".gal-prev").removeClass("gal-inactive gal-prev").addClass("gal-active"); imageContainer.find(".gal-prev").removeClass("gal-inactive gal-prev").addClass("gal-active");
thumbStrip.css("left", (parseInt(thumbStrip.css("left")) + 66) + "px"); thumbStrip.css("left", (parseInt(thumbStrip.css("left")) + 66) + "px");
} }
}
mainPicLoading = 1; mainPicLoading = 1;
} }
descriptionArea.html("<p>" + currentPic.image.description + "</p>"); descriptionArea.html("<p>" + currentPic.image.description + "</p>");
@ -544,6 +535,7 @@ window.GalleryTheater = function() {
}) })
} else { } else {
nextPicLoading = 1; nextPicLoading = 1;
$("img.gallery-image.gal-next.gal-inactive").remove();
} }
} }
@ -563,6 +555,7 @@ window.GalleryTheater = function() {
}) })
} else { } else {
prevPicLoading = 1; prevPicLoading = 1;
$("img.gallery-image.gal-prev.gal-inactive").remove();
} }
} }