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) })