4,092
edits
No edit summary |
No edit summary Tag: Reverted |
||
Line 492: | Line 492: | ||
function toggleImage() { | function toggleImage() { | ||
// Hide the current image | |||
$('.article-images .image-container').eq(currentIndex).addClass('hidden'); | |||
// Calculate the index of the next image | |||
currentIndex = (currentIndex + 1) % totalImages; | |||
// Show the next image | |||
$('.article-images .image-container').eq(currentIndex).removeClass('hidden'); | |||
var image = images[currentIndex]; | |||
console.log("Toggling to image index:", currentIndex, "Src:", image.src); | |||
// You don't need to update the HTML of .article-images here if you are just toggling visibility | |||
} | |||
// Updated event binding | // Updated event binding | ||
$('#article-content').on('click', '.image-container img', function () { | $('#article-content').on('click', '.image-container img', function () { |