4,114
edits
No edit summary Tag: Reverted |
No edit summary Tag: Reverted |
||
Line 11: | Line 11: | ||
console.log('Found all cards:', cards); | console.log('Found all cards:', cards); | ||
// | // Attach a click event listener to each card | ||
function | cards.on('click', function (event) { | ||
// Show the fixed column | // Show the fixed column | ||
showArticleWrapper.css('display', 'block'); | showArticleWrapper.css('display', 'block'); | ||
// Update the fixed column content with card information | // Update the fixed column content with card information | ||
var entryNumber = | var entryNumber = $(this).find('.entry-number').text(); | ||
var title = | var title = $(this).find('.title').text(); | ||
var people = | var people = $(this).find('.people').text(); | ||
var type = | var type = $(this).find('.type').text(); | ||
var entity = | var entity = $(this).find('.entity').text(); | ||
var discipline = | var discipline = $(this).find('.discipline').text(); | ||
var subject = | var subject = $(this).find('.subject').text(); | ||
var description = | var description = $(this).find('.description').html(); | ||
var reflection = | var reflection = $(this).find('.reflection').html(); | ||
var quote = | var quote = $(this).find('.quote').text(); | ||
var modificationDate = | var modificationDate = $(this).find('.modification-date').text(); | ||
var imageCount = 5; // Change this value based on the maximum number of images | var imageCount = 5; // Change this value based on the maximum number of images | ||
Line 35: | Line 35: | ||
// Loop through possible image containers | // Loop through possible image containers | ||
for (var i = 1; i <= imageCount; i++) { | for (var i = 1; i <= imageCount; i++) { | ||
var imageContainer = | var imageContainer = $(this).find('.image' + i); | ||
// Check if the image container exists | // Check if the image container exists | ||
Line 130: | Line 130: | ||
// Apply the fade-out effect to the #list element | // Apply the fade-out effect to the #list element | ||
$('#list').addClass('fade-out'); | $('#list').addClass('fade-out'); | ||
// Prevent further propagation to the document | // Prevent further propagation to the document |