You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
968 B
22 lines
968 B
// Function to update the content
|
|
function updateLocationContent(locationKey) {
|
|
const location = locationData[locationKey];
|
|
if (location) {
|
|
document.getElementById('location-text').innerText = location.text;
|
|
document.getElementById('location-img').src = location.imageUrl;
|
|
document.getElementById('location-direction').href = location.direction;
|
|
}
|
|
}
|
|
|
|
document.querySelectorAll('.location-button').forEach(button => {
|
|
button.addEventListener('click', (event) => {
|
|
const index = event.currentTarget.getAttribute('data-location');
|
|
const locInfo = window.locInfo; // We'll inject this below
|
|
const location = locInfo[index];
|
|
if (location) {
|
|
document.getElementById('location-text').innerText = location.directions;
|
|
document.getElementById('location-img').src = location.image;
|
|
document.getElementById('location-direction').href = location.url;
|
|
}
|
|
});
|
|
});
|