Jump to content

MediaWiki:Common.js: Difference between revisions

From VassarWiki
added flex js
 
.poster
 
Line 2: Line 2:
document.addEventListener('DOMContentLoaded', function() {
document.addEventListener('DOMContentLoaded', function() {
   document.querySelectorAll('.poster-container').forEach(container => {
   document.querySelectorAll('.poster-container').forEach(container => {
     const items = Array.from(container.querySelectorAll('.poster-item'));
     const items = Array.from(container.querySelectorAll('.poster'));
     if (items.length === 0) return;
     if (items.length === 0) return;
     const firstWidth = items[0].offsetWidth;
     const firstWidth = items[0].offsetWidth;

Latest revision as of 20:37, 14 May 2026

/* Any JavaScript here will be loaded for all users on every page load. */
document.addEventListener('DOMContentLoaded', function() {
  document.querySelectorAll('.poster-container').forEach(container => {
    const items = Array.from(container.querySelectorAll('.poster'));
    if (items.length === 0) return;
    const firstWidth = items[0].offsetWidth;
    items.forEach(item => item.style.width = firstWidth + 'px');
  });
});