HOUR BY HOUR | When next measurable snow moves through Cincinnati Tuesday
HOUR BY HOUR | When next measurable snow moves through Cincinnati Tuesday
WITH NO QUESTIONS ASKED. WE ARE TOLD THAT BABY IS DOING WELL. ALL RIGHT. TURNING TO OUR WEATHER NOW, CHIEF METEOROLOGIST KEVIN ROBINSON IS HERE AND WE ARE ON THE EVE OF WHAT WILL BE ANOTHER ROUND OF SNOW TOMORROW. AND IT’S GOING TO BE STARTING PRETTY EARLY, MAYBE AS PEOPLE ARE JUST GETTING OUT OF THE HOUSE. YEAH, THE MORNING COMMUTE TOMORROW LIKELY TO BE IMPACTED TO SOME EXTENT BY FALLING SNOW IN THE MORNING. SO HERE’S A LOOK AT THE SYSTEM TONIGHT. THE STEADIEST OF THE SNOW WILL BE IN THE MID MORNING INTO THE EARLY AFTERNOON. WE DO ANTICIPATE SNOW COVERED ROADS AROUND HERE 1 TO 3IN FOR MOST OF US. BUT THERE WILL BE A CORRIDOR THAT SEES SLIGHTLY HEAVIER AMOUNTS THAT WE CONTINUE TO TRY TO KIND OF REALLY NARROW IN ON. SO OVERALL, THE TUESDAY SNOW TIMELINE SNOW ARRIVES AROUND SUNRISE. YOU KNOW, THAT’S A LITTLE BIT OF A WINDOW THERE. SO IF YOU START YOUR COMMUTE EARLIER YOU START THE LESS LIKELY YOU ARE TO BE IMPACTED BY SNOW. BUT THE LATER IN THE COMMUTE YOU WAIT, THE MORE LIKELY YOU ARE TO BE IMPACTED. BUT BY MID-MORNING, I THINK MOST OF US HAVE SNOW THROUGH THE EARLY AFTERNOON BEFORE IT BEGINS TO TAPER OFF DURING THE EVENING. SO AGAIN, GENERALLY 1 TO 3IN OF SNOW FOR MOST OF US. BUT THERE DOES APPEAR TO BE A CORRIDOR SOMEWHERE AROUND THE METRO AND THEN DOWN ALONG THE OHIO RIVER. AS WE HEAD EAST OF CINCINNATI, SOMEONE IS LIKELY TO PICK UP 3 TO 5IN OF SNOW IN AN AREA THAT WILL LIKELY SEE HEAVIER AMOUNTS. IT’S NOT A BROAD AREA, BUT CERTAINLY THE POTENTIAL IS THERE. SO LET ME SHOW YOU HOW THINGS LOOK ON FUTURECAST TAKE YOU INTO THE MORNING. THIS IS 6 A.M. IT’S STILL RELATIVELY QUIET. WATCH HOW QUICKLY THE SNOW BUILDS IN. THERE’S A LOOK AT SEVEN, TAKE YOU TOWARDS EIGHT AND NINE, AND ALREADY BY THIS POINT SHOULD BE SNOWING AT A GOOD CLIP ACROSS A GOOD PART OF THE METRO. AND I ALREADY THINK BY 9:00 OR SO WE COULD ALREADY BEGIN TO SEE ROADS BECOMING SNOW COVERED ACROSS THE AREA. YOU SEE HOW THE SNOW EXPANDS THROUGH LUNCHTIME AND THEN LIKELY CONTINUES AT A PRETTY DECENT CLIP THROUGH THE EARLY AFTERNOON, PARTICULARLY WHERE YOU SEE SOME OF THESE REALLY DARK BLUES. THAT’S GOING TO BE SOME PRETTY HEAVY SNOW THERE THROUGH THE AFTERNOON HOURS. SO AGAIN, TAPERING OFF SOMETIME AFTER 3 OR 4:00 TOMORROW AFTERNOON. RADAR, TONIGHT IS PRETTY QUIET TEMPERATURE WISE OUT THERE. IT’S A COLD ONE, RIGHT? MOST OF US ARE HOVERING IN THE UPPER 20S TO RIGHT AROUND 30 TONIGHT. SO OFFICIALLY HERE IN CINCINNATI, WE’VE GOT A LITTLE BIT OF A LIGHT WIND. WIND CHILL TONIGHT. 25. THIS IS THE WARMEST IT’S BEEN IN A WEEK FOR US THE NEXT 12 HOURS. TAKING YOU DOWN INTO THE 20S TONIGHT. AND THEN YOU CAN SEE THE SNOW BEGINNING TO COME IN TOWARDS DAYBREAK. SO QUIET AND COLD TONIGHT. 24 FOR YOUR OVERNIGHT LOW. AND THEN FOR TOMORROW WE’RE BACK UP TO ABOUT 2930 FOR A HIGH SNOW. OCCASIONALLY HEAVY AT TIMES, ENDING BEFORE THE EVENING. HERE’S A LOOK AT YOUR PLANNER AGAIN. MOST IMPACTFUL MID MORNING THROUGH EARLY AFTERNOON OR MID AFTERNOON AT LEAST. AND THEN IT TAPERS OFF. HERE’S YOUR SEVEN DAY FORECAST. BEHIND THE SNOW CHRIS COMES A FRESH BATCH OF COLD AIR TO TAKE US THROUGH THE END OF THE WEEK. MAYBE ABOVE FREEZING BRIEFLY THERE ON FRIDAY, ONLY TO SEE THOSE TEMPERATURES LIKELY COME BACK DOWN OV
Arctic air holds its grip on Cincinnati trough the start of the week. We’re also eyeing our next chance of snow.LIVE RADAR // LATEST WEATHER ALERTS // TRAFFIC MAPChance For SnowKeep the shovels handy. Our next snow potential comes into play on Tuesday. Right now, it looks like we see measurable accumulations. Most get 1-3 inches of snow. There are signals for heavier bands of snow to set up, which would lead to higher totals around 3-5 inches wherever that happens. Right now, it looks like that will be around the metro and spots just east.» Follow WLWT: Facebook | Twitter | InstagramNo Signals For Warmer WeatherThat snow chance keeps us in the freezer! Highs now look to stay below freezing through Thursday. We MAY briefly warm up to 35 on Friday, but it’s short-lived. We likely stay cold through at least Valentine’s Day.WLWT Weather is Cincinnati’s Most Accurate Forecast, confirmed by WeatheRate, a national research company. The WLWT Weather team led by Chief Meteorologist Kevin Robinson is the only station each year to earn the Most Accurate rating.
Arctic air holds its grip on Cincinnati trough the start of the week. We’re also eyeing our next chance of snow.
LIVE RADAR // LATEST WEATHER ALERTS // TRAFFIC MAP
Chance For Snow
Keep the shovels handy. Our next snow potential comes into play on Tuesday. Right now, it looks like we see measurable accumulations.
Most get 1-3 inches of snow. There are signals for heavier bands of snow to set up, which would lead to higher totals around 3-5 inches wherever that happens. Right now, it looks like that will be around the metro and spots just east.
» Follow WLWT: Facebook | Twitter | Instagram
No Signals For Warmer Weather
That snow chance keeps us in the freezer! Highs now look to stay below freezing through Thursday. We MAY briefly warm up to 35 on Friday, but it’s short-lived. We likely stay cold through at least Valentine’s Day.
WLWT Weather is Cincinnati’s Most Accurate Forecast, confirmed by WeatheRate, a national research company. The WLWT Weather team led by Chief Meteorologist Kevin Robinson is the only station each year to earn the Most Accurate rating.
`;
}
function refreshWeatherIframe(containerId) {
var iframeId = ‘weather-iframe-‘ + containerId;
var iframe = document.getElementById(iframeId);
if (iframe && iframe.src) {
var originalSrc = iframe.src;
iframe.src = originalSrc + (originalSrc.indexOf(‘?’) > -1 ? ‘&’ : ‘?’) + ‘t=” + Date.now();
}
}
function initializeWeatherBox(container) {
var containerId = container.getAttribute(“data-container-id’);
var isWeatherBoxV2 = containerId === ‘home-weather-v2’;
function switchWeatherTab(tabName, clickedElement) {
container.querySelectorAll(‘[data-tab-id]’).forEach(function(tab) {
tab.classList.remove(‘open’);
tab.setAttribute(‘aria-selected’, ‘false’);
});
clickedElement.classList.add(‘open’);
clickedElement.setAttribute(‘aria-selected’, ‘true’);
container.querySelectorAll(‘[data-content-id]’).forEach(function(content) {
content.style.display = ‘none’;
content.setAttribute(‘hidden’, ‘true’);
});
var targetContent = container.querySelector(‘[data-content-id=”‘ + tabName + ‘”]’);
if (targetContent) {
targetContent.style.display = ‘block’;
targetContent.removeAttribute(‘hidden’);
}
}
function loadWeatherData() {
// If weather data is already being loaded, wait for it
if (window.weatherDataPromise) {
window.weatherDataPromise.then(function(data) {
if (data && data.data) {
var weatherContainer = container.closest(‘.weather-box-container’);
if (weatherContainer) {
weatherContainer.style.display = ‘flex’;
updateCurrentWeather(data.data);
updateForecastTabs(data.data);
updateWeatherAlertsBar(data.data);
}
}
});
return;
}
var location = { zip: window.DEFAULT_ZIPCODE };
try {
var storedLocations = localStorage.getItem(‘hrst.zip.history’);
if (storedLocations) {
var locations = JSON.parse(storedLocations);
if (locations && locations.length > 0) {
location = locations[0];
}
}
} catch (e) {}
var apiUrl = (window.DEWY_HOSTNAME || ”) + ‘/api/v1/weather/full/’ + location.zip;
if (window.fetch) {
window.weatherDataPromise = fetch(apiUrl)
.then(function(response) { return response.json(); })
.then(function(data) {
if (data && data.data) {
var article = container.closest(‘.article–wrapper’);
var weatherContainer = container.closest(‘.weather-box-container’);
if (weatherContainer) {
weatherContainer.style.display = ‘flex’;
updateCurrentWeather(data.data);
updateForecastTabs(data.data);
updateWeatherAlertsBar(data.data);
}
return data;
}
})
.catch(function(error) {
console.error(‘Error loading weather:’, error);
// Reset to unknown background on error
updateWeatherBackground(‘unknown’);
});
}
}
function updateWeatherAlertsBar(weatherData) {
var weatherWatchHeader = container.querySelector(‘.weather-watch-header’);
if (weatherWatchHeader && weatherData.alerts_count > 0) {
weatherWatchHeader.className=”weather-watch-header has-alerts”;
var weatherWatchText = weatherWatchHeader.querySelector(‘.weather-watch-text’);
var weatherWatchLink = weatherWatchHeader.querySelector(‘.weather-watch-link’);
if (weatherWatchText) {
weatherWatchText.textContent = `Weather Alerts (${weatherData.alerts_count})`;
}
if (weatherWatchLink) {
weatherWatchLink.setAttribute(‘onclick’, “return handleWeatherLinkClick(event, ‘click_alerts’, ‘click’, ‘mobile-weather’, “https://www.wlwt.com/alerts”);”);
}
}
}
function updateCurrentWeather(weatherData) {
if (weatherData.current) {
var tempValue = weatherData.current.temp_f || ”;
var skyValue = weatherData.current.sky || ”;
var feelsLikeValue = weatherData.current.feels_like_f || weatherData.current.temp_f || ”;
var tempEl = container.querySelector(‘.weather-grid–current-temp-value’);
if (tempEl) {
tempEl.textContent = tempValue;
tempEl.setAttribute(‘aria-label’, tempValue + ‘ degrees Fahrenheit’);
}
var iconEl = container.querySelector(‘.weather-grid–current-icon’);
if (iconEl && weatherData.current.icon_name) {
iconEl.className=”weather-grid–current-icon weather-current-icon icon icon-weather-” + weatherData.current.icon_name;
}
var skyEl = container.querySelector(‘.weather-grid–sky’);
if (skyEl) {
skyEl.textContent = skyValue;
skyEl.setAttribute(‘aria-label’, ‘Current condition: ‘ + skyValue);
}
var feelsEl = container.querySelector(‘.weather-grid–feels’);
if (feelsEl) {
feelsEl.textContent = feelsLikeValue + ‘°F’;
feelsEl.setAttribute(‘aria-label’, feelsLikeValue + ‘ degrees Fahrenheit’);
}
var weatherContainer = container.querySelector(‘.weather-temp-container’);
if (weatherContainer) {
var summary = ‘Current temperature ‘ + tempValue + ‘ degrees Fahrenheit, ‘ +
skyValue + ‘, feels like ‘ + feelsLikeValue + ‘ degrees’;
weatherContainer.setAttribute(‘aria-label’, summary);
}
updateWeatherBackground(weatherData.current.icon_name);
}
}
function updateWeatherBackground(iconName) {
try {
var bgPath = weatherImages.backgrounds[iconName] || weatherImages.backgrounds.unknown;
container.style.backgroundImage=”url(” + bgPath + ‘)’;
} catch (e) {
console.log(‘Error updating weather background:’, e);
}
}
function updateForecastTabs(weatherData) {
var visibleItems = isWeatherBoxV2 ? 6 : 5;
if (weatherData.hourly) {
var hourlyContainer = container.querySelector(‘.weather-hourly-forecast’);
if (hourlyContainer) {
var html=””;
var maxHours = Math.min(visibleItems, weatherData.hourly.length);
for (var i = 0; i < maxHours; i++) {
var hour = weatherData.hourly[i];
html += generateForecastItem({
timeLabel: hour.hour_display,
iconName: hour.icon_name,
primaryTemp: hour.temp_f,
secondaryInfo: hour.precip_chance + ‘%’
});
}
hourlyContainer.innerHTML = html;
}
}
if (weatherData.daily) {
var dailyContainer = container.querySelector(‘.weather-daily-forecast’);
if (dailyContainer) {
var html=””;
var maxDays = Math.min(visibleItems, weatherData.daily.length);
for (var i = 0; i < maxDays; i++) {
var day = weatherData.daily[i];
var dayName = getShortDayName(day.day);
html += generateForecastItem({
timeLabel: dayName,
iconName: day.icon_name,
primaryTemp: day.high_f,
secondaryInfo: day.precip_chance + ‘%’
});
}
dailyContainer.innerHTML = html;
}
}
}
function getShortDayName(dayName) {
switch (dayName) {
case ‘Today’:
return ‘Today’;
case ‘Tomorrow’:
return ‘Tmrw’;
case ‘Sunday’:
return ‘Sun’;
case ‘Monday’:
return ‘Mon’;
case ‘Tuesday’:
return ‘Tue’;
case ‘Wednesday’:
return ‘Wed’;
case ‘Thursday’:
return ‘Thu’;
case ‘Friday’:
return ‘Fri’;
case ‘Saturday’:
return ‘Sat’;
default:
return dayName;
}
}
container.querySelectorAll(‘[data-tab-id]’).forEach(function(tab) {
var isActive = tab.classList.contains(‘open’);
tab.setAttribute(‘tabindex’, ‘0’); // Both tabs focusable for VoiceOver
tab.setAttribute(‘role’, ‘tab’);
tab.setAttribute(‘aria-selected’, isActive);
tab.addEventListener(‘keydown’, function(e) {
var tabs = Array.from(container.querySelectorAll(‘[data-tab-id]’));
var currentIndex = tabs.indexOf(this);
switch(e.key) {
case ‘ArrowLeft’:
e.preventDefault();
var prevIndex = currentIndex > 0 ? currentIndex – 1 : tabs.length – 1;
tabs[prevIndex].focus();
break;
case ‘ArrowRight’:
e.preventDefault();
var nextIndex = currentIndex < tabs.length – 1 ? currentIndex + 1 : 0;
tabs[nextIndex].focus();
break;
case ‘Enter’:
case ‘ ‘:
e.preventDefault();
var tabId = this.getAttribute(‘data-tab-id’);
switchWeatherTab(tabId, this);
if (tabId === ‘hourly’) {
dispatchWeatherGA4Event(‘click_hourly’, ‘click’, containerId);
} else if (tabId === ‘daily’) {
dispatchWeatherGA4Event(‘click_daily’, ‘click’, containerId);
}
break;
}
});
tab.onclick = function() {
var tabId = this.getAttribute(‘data-tab-id’);
switchWeatherTab(tabId, this);
if (tabId === ‘hourly’) {
dispatchWeatherGA4Event(‘click_hourly’, ‘click’, containerId);
} else if (tabId === ‘daily’) {
dispatchWeatherGA4Event(‘click_daily’, ‘click’, containerId);
}
return false;
};
});
loadWeatherData();
window.addEventListener(‘pageshow’, function(event) {
if (event.persisted) {
// Fix for weather radar iframe appearing gray after browser back/forward navigation
// When user navigates back, the page loads from browser cache but the iframe
// content doesn’t restore properly, showing a gray screen instead of the radar map
// This forces a fresh reload of the iframe by adding a timestamp parameter
setTimeout(function() {
refreshWeatherIframe(containerId);
}, 300);
}
});
}
document.querySelectorAll(‘.weather-sidebar’).forEach(function(weatherBox) {
initializeWeatherBox(weatherBox);
});
document.addEventListener(‘fullscreenchange’, function() {
var fullscreenElement = document.fullscreenElement;
if (!fullscreenElement) {
document.querySelector(‘.weather-box-container’).querySelectorAll(‘.fa-times’).forEach(function(icon) {
icon.classList.remove(‘fa-times’);
icon.classList.add(‘fa-expand’);
});
}
});
});
`;
}
function refreshWeatherIframe(containerId) {
var iframeId = ‘weather-iframe-‘ + containerId;
var iframe = document.getElementById(iframeId);
if (iframe && iframe.src) {
var originalSrc = iframe.src;
iframe.src = originalSrc + (originalSrc.indexOf(‘?’) > -1 ? ‘&’ : ‘?’) + ‘t=” + Date.now();
}
}
function initializeWeatherBox(container) {
var containerId = container.getAttribute(“data-container-id’);
var isWeatherBoxV2 = containerId === ‘home-weather-v2’;
function switchWeatherTab(tabName, clickedElement) {
container.querySelectorAll(‘[data-tab-id]’).forEach(function(tab) {
tab.classList.remove(‘open’);
tab.setAttribute(‘aria-selected’, ‘false’);
});
clickedElement.classList.add(‘open’);
clickedElement.setAttribute(‘aria-selected’, ‘true’);
container.querySelectorAll(‘[data-content-id]’).forEach(function(content) {
content.style.display = ‘none’;
content.setAttribute(‘hidden’, ‘true’);
});
var targetContent = container.querySelector(‘[data-content-id=”‘ + tabName + ‘”]’);
if (targetContent) {
targetContent.style.display = ‘block’;
targetContent.removeAttribute(‘hidden’);
}
}
function loadWeatherData() {
// If weather data is already being loaded, wait for it
if (window.weatherDataPromise) {
window.weatherDataPromise.then(function(data) {
if (data && data.data) {
var weatherContainer = container.closest(‘.weather-box-container’);
if (weatherContainer) {
weatherContainer.style.display = ‘flex’;
updateCurrentWeather(data.data);
updateForecastTabs(data.data);
updateWeatherAlertsBar(data.data);
}
}
});
return;
}
var location = { zip: window.DEFAULT_ZIPCODE };
try {
var storedLocations = localStorage.getItem(‘hrst.zip.history’);
if (storedLocations) {
var locations = JSON.parse(storedLocations);
if (locations && locations.length > 0) {
location = locations[0];
}
}
} catch (e) {}
var apiUrl = (window.DEWY_HOSTNAME || ”) + ‘/api/v1/weather/full/’ + location.zip;
if (window.fetch) {
window.weatherDataPromise = fetch(apiUrl)
.then(function(response) { return response.json(); })
.then(function(data) {
if (data && data.data) {
var article = container.closest(‘.article–wrapper’);
var weatherContainer = container.closest(‘.weather-box-container’);
if (weatherContainer) {
weatherContainer.style.display = ‘flex’;
updateCurrentWeather(data.data);
updateForecastTabs(data.data);
updateWeatherAlertsBar(data.data);
}
return data;
}
})
.catch(function(error) {
console.error(‘Error loading weather:’, error);
// Reset to unknown background on error
updateWeatherBackground(‘unknown’);
});
}
}
function updateWeatherAlertsBar(weatherData) {
var weatherWatchHeader = container.querySelector(‘.weather-watch-header’);
if (weatherWatchHeader && weatherData.alerts_count > 0) {
weatherWatchHeader.className=”weather-watch-header has-alerts”;
var weatherWatchText = weatherWatchHeader.querySelector(‘.weather-watch-text’);
var weatherWatchLink = weatherWatchHeader.querySelector(‘.weather-watch-link’);
if (weatherWatchText) {
weatherWatchText.textContent = `Weather Alerts (${weatherData.alerts_count})`;
}
if (weatherWatchLink) {
weatherWatchLink.setAttribute(‘onclick’, “return handleWeatherLinkClick(event, ‘click_alerts’, ‘click’, ‘sidelist-weather’, “https://www.wlwt.com/alerts”);”);
}
}
}
function updateCurrentWeather(weatherData) {
if (weatherData.current) {
var tempValue = weatherData.current.temp_f || ”;
var skyValue = weatherData.current.sky || ”;
var feelsLikeValue = weatherData.current.feels_like_f || weatherData.current.temp_f || ”;
var tempEl = container.querySelector(‘.weather-grid–current-temp-value’);
if (tempEl) {
tempEl.textContent = tempValue;
tempEl.setAttribute(‘aria-label’, tempValue + ‘ degrees Fahrenheit’);
}
var iconEl = container.querySelector(‘.weather-grid–current-icon’);
if (iconEl && weatherData.current.icon_name) {
iconEl.className=”weather-grid–current-icon weather-current-icon icon icon-weather-” + weatherData.current.icon_name;
}
var skyEl = container.querySelector(‘.weather-grid–sky’);
if (skyEl) {
skyEl.textContent = skyValue;
skyEl.setAttribute(‘aria-label’, ‘Current condition: ‘ + skyValue);
}
var feelsEl = container.querySelector(‘.weather-grid–feels’);
if (feelsEl) {
feelsEl.textContent = feelsLikeValue + ‘°F’;
feelsEl.setAttribute(‘aria-label’, feelsLikeValue + ‘ degrees Fahrenheit’);
}
var weatherContainer = container.querySelector(‘.weather-temp-container’);
if (weatherContainer) {
var summary = ‘Current temperature ‘ + tempValue + ‘ degrees Fahrenheit, ‘ +
skyValue + ‘, feels like ‘ + feelsLikeValue + ‘ degrees’;
weatherContainer.setAttribute(‘aria-label’, summary);
}
updateWeatherBackground(weatherData.current.icon_name);
}
}
function updateWeatherBackground(iconName) {
try {
var bgPath = weatherImages.backgrounds[iconName] || weatherImages.backgrounds.unknown;
container.style.backgroundImage=”url(” + bgPath + ‘)’;
} catch (e) {
console.log(‘Error updating weather background:’, e);
}
}
function updateForecastTabs(weatherData) {
var visibleItems = isWeatherBoxV2 ? 6 : 5;
if (weatherData.hourly) {
var hourlyContainer = container.querySelector(‘.weather-hourly-forecast’);
if (hourlyContainer) {
var html=””;
var maxHours = Math.min(visibleItems, weatherData.hourly.length);
for (var i = 0; i < maxHours; i++) {
var hour = weatherData.hourly[i];
html += generateForecastItem({
timeLabel: hour.hour_display,
iconName: hour.icon_name,
primaryTemp: hour.temp_f,
secondaryInfo: hour.precip_chance + ‘%’
});
}
hourlyContainer.innerHTML = html;
}
}
if (weatherData.daily) {
var dailyContainer = container.querySelector(‘.weather-daily-forecast’);
if (dailyContainer) {
var html=””;
var maxDays = Math.min(visibleItems, weatherData.daily.length);
for (var i = 0; i < maxDays; i++) {
var day = weatherData.daily[i];
var dayName = getShortDayName(day.day);
html += generateForecastItem({
timeLabel: dayName,
iconName: day.icon_name,
primaryTemp: day.high_f,
secondaryInfo: day.precip_chance + ‘%’
});
}
dailyContainer.innerHTML = html;
}
}
}
function getShortDayName(dayName) {
switch (dayName) {
case ‘Today’:
return ‘Today’;
case ‘Tomorrow’:
return ‘Tmrw’;
case ‘Sunday’:
return ‘Sun’;
case ‘Monday’:
return ‘Mon’;
case ‘Tuesday’:
return ‘Tue’;
case ‘Wednesday’:
return ‘Wed’;
case ‘Thursday’:
return ‘Thu’;
case ‘Friday’:
return ‘Fri’;
case ‘Saturday’:
return ‘Sat’;
default:
return dayName;
}
}
container.querySelectorAll(‘[data-tab-id]’).forEach(function(tab) {
var isActive = tab.classList.contains(‘open’);
tab.setAttribute(‘tabindex’, ‘0’); // Both tabs focusable for VoiceOver
tab.setAttribute(‘role’, ‘tab’);
tab.setAttribute(‘aria-selected’, isActive);
tab.addEventListener(‘keydown’, function(e) {
var tabs = Array.from(container.querySelectorAll(‘[data-tab-id]’));
var currentIndex = tabs.indexOf(this);
switch(e.key) {
case ‘ArrowLeft’:
e.preventDefault();
var prevIndex = currentIndex > 0 ? currentIndex – 1 : tabs.length – 1;
tabs[prevIndex].focus();
break;
case ‘ArrowRight’:
e.preventDefault();
var nextIndex = currentIndex < tabs.length – 1 ? currentIndex + 1 : 0;
tabs[nextIndex].focus();
break;
case ‘Enter’:
case ‘ ‘:
e.preventDefault();
var tabId = this.getAttribute(‘data-tab-id’);
switchWeatherTab(tabId, this);
if (tabId === ‘hourly’) {
dispatchWeatherGA4Event(‘click_hourly’, ‘click’, containerId);
} else if (tabId === ‘daily’) {
dispatchWeatherGA4Event(‘click_daily’, ‘click’, containerId);
}
break;
}
});
tab.onclick = function() {
var tabId = this.getAttribute(‘data-tab-id’);
switchWeatherTab(tabId, this);
if (tabId === ‘hourly’) {
dispatchWeatherGA4Event(‘click_hourly’, ‘click’, containerId);
} else if (tabId === ‘daily’) {
dispatchWeatherGA4Event(‘click_daily’, ‘click’, containerId);
}
return false;
};
});
loadWeatherData();
window.addEventListener(‘pageshow’, function(event) {
if (event.persisted) {
// Fix for weather radar iframe appearing gray after browser back/forward navigation
// When user navigates back, the page loads from browser cache but the iframe
// content doesn’t restore properly, showing a gray screen instead of the radar map
// This forces a fresh reload of the iframe by adding a timestamp parameter
setTimeout(function() {
refreshWeatherIframe(containerId);
}, 300);
}
});
}
document.querySelectorAll(‘.weather-sidebar’).forEach(function(weatherBox) {
initializeWeatherBox(weatherBox);
});
document.addEventListener(‘fullscreenchange’, function() {
var fullscreenElement = document.fullscreenElement;
if (!fullscreenElement) {
document.querySelector(‘.weather-box-container’).querySelectorAll(‘.fa-times’).forEach(function(icon) {
icon.classList.remove(‘fa-times’);
icon.classList.add(‘fa-expand’);
});
}
});
});
Loading more articles…