Anonym

MediaWiki:Common.js: Forskelle mellem versioner

Fra AarhusWiki
ingen redigeringsopsummering
mNo edit summary
Tag: Tilbagerullet
No edit summary
Tag: Manuel tilbagerulning
Linje 54: Linje 54:
   }
   }
});
});
// Function to adjust map container width on page load and resize
function adjustMapContainerWidth() {
  var mapContainer = document.getElementById('custom-map-container');
  if (mapContainer) {
    var screenWidth = window.innerWidth;
    var maxWidth = (screenWidth <= 768) ? 350 : 600; // Adjust widths for mobile and iPad screens
    mapContainer.style.maxWidth = maxWidth + 'px';
  }
}
// Call the function on page load and when the screen is resized
document.addEventListener('DOMContentLoaded', adjustMapContainerWidth);
window.addEventListener('resize', adjustMapContainerWidth);