4,408
edits
No edit summary |
No edit summary |
||
Line 7: | Line 7: | ||
var listList = $('#list-list'); | var listList = $('#list-list'); | ||
var filteredListItems = $('#list .filtered-list-item'); // Selecting filtered-list-items in #list | var filteredListItems = $('#list .filtered-list-item'); // Selecting filtered-list-items in #list | ||
var originalListWidth = list.width(); // Store the original width for #list | // var originalListWidth = list.width(); // Store the original width for #list | ||
var listLists = [$('#list-list'), $('#list-list-1'), $('#list-list-2'), $('#list-list-3')]; // Store jQuery objects in an array | |||
var listLists = [$('#list'), ('#list-list'), $('#list-list-1'), $('#list-list-2'), $('#list-list-3')]; // Store jQuery objects in an array | |||
var originalWidths = listLists.map(function(list) { | var originalWidths = listLists.map(function(list) { | ||
return list.width(); | return list.width(); | ||
Line 185: | Line 186: | ||
showArticleWrapper.css('display', 'block'); | showArticleWrapper.css('display', 'block'); | ||
var wrapperWidth = showArticleWrapper.outerWidth(true); | /* var wrapperWidth = showArticleWrapper.outerWidth(true); | ||
console.log('Wrapper width:', wrapperWidth); | console.log('Wrapper width:', wrapperWidth); | ||
var adjustment = 25; // Adjust this value as needed to close the gap | var adjustment = 25; // Adjust this value as needed to close the gap | ||
list.width(originalListWidth - wrapperWidth + adjustment).css('margin-right', (wrapperWidth) + 'px'); | list.width(originalListWidth - wrapperWidth + adjustment).css('margin-right', (wrapperWidth) + 'px'); */ | ||
// Adjust width of filtered-list-items in #list | // Adjust width of filtered-list-items in #list | ||
filteredListItems.css('width', 'calc(33.15% - 0px)'); | // filteredListItems.css('width', 'calc(33.15% - 0px)'); | ||
// Set new width using .each() to iterate over the jQuery objects | // Set new width using .each() to iterate over the jQuery objects | ||
Line 440: | Line 441: | ||
function closeModal() { | function closeModal() { | ||
showArticleWrapper.hide(); | showArticleWrapper.hide(); | ||
list.width(originalListWidth).css('margin-right', '0'); | // list.width(originalListWidth).css('margin-right', '0'); | ||
// Revert width of filtered-list-items in #list | // Revert width of filtered-list-items in #list | ||
filteredListItems.css('width', 'calc(20% - 0px)'); | // filteredListItems.css('width', 'calc(20% - 0px)'); | ||
// Revert width of filtered-list-items in listLists | // Revert width of filtered-list-items in listLists |