From 08ad4f379049dffec7b2f2687b5e3a49b163a70b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Sat, 11 Mar 2023 11:51:41 +0800 Subject: [PATCH] fix error --- app/assets/javascripts/theater.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/theater.js b/app/assets/javascripts/theater.js index f376069..c86af10 100644 --- a/app/assets/javascripts/theater.js +++ b/app/assets/javascripts/theater.js @@ -437,10 +437,13 @@ window.GalleryTheater = function() { $('div.gallery-show-original a').eq(0).attr('href', currentPic.image.url) img = imageContainer.find(".gal-active"); if (direction == null) { + if (img.length==0){ + img = $(""); + imageContainer.append(img); + } img.hide(); img.attr("src", currentPic.image.file.theater.url); img.attr("alt", currentPic.image.alt_title); - imageContainer.append(img); img.one("load", function() { one_load(img) })