4,396
edits
No edit summary |
No edit summary |
||
Line 127: | Line 127: | ||
currentIndex = (currentIndex + 1) % totalImages; | currentIndex = (currentIndex + 1) % totalImages; | ||
var image = images[currentIndex]; | var image = images[currentIndex]; | ||
var articleImageContainer = $('#article-content').find('.article-images'); | |||
articleImageContainer.html(getImageHtml(image, currentIndex, totalImages)); | |||
} | } | ||
Line 135: | Line 135: | ||
toggleImage(); | toggleImage(); | ||
}); | }); | ||
} | } | ||
function getImageHtml(image, currentIndex, totalImages) { | function getImageHtml(image, currentIndex, totalImages) { | ||
var imageLabel = (currentIndex + 1) + '/' + totalImages + ' IMAGES'; | var imageLabel = (currentIndex + 1) + '/' + totalImages + ' IMAGES'; | ||
return '<div class="image-container">' + | return '<div class="article-images">' + | ||
'<p class="article-label-image">' + imageLabel + '</p>' + | |||
'<div class="image-container">' + | |||
'<img src="' + image.src + '" alt="' + image.alt + '">' + | |||
'<div class="' + image.captionClass + '">' + image.caption + '</div>' + | |||
} | '</div>' + | ||
'</div>'; | |||
} | |||
// Attach a mousedown event listener to close the fixed column | // Attach a mousedown event listener to close the fixed column |