MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Tag: Reverted
Line 492: Line 492:
      
      
         function toggleImage() {
         function toggleImage() {
            currentIndex = (currentIndex + 1) % totalImages;
    // Hide the current image
            var image = images[currentIndex];
    $('.article-images .image-container').eq(currentIndex).addClass('hidden');
            console.log("Toggling to image index:", currentIndex, "Src:", image.src);
            $('#article-content').find('.article-images').html(getImageHtml(image, currentIndex, totalImages));
    // 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 () {

Navigation menu